走过海棠暮

文章 0 评论 0 浏览 24

走过海棠暮 2024-12-12 05:08:36
for dir in PARENT/*
do
  test -d "$dir" || continue
  # Do something with $dir...
done
for dir in PARENT/*
do
  test -d "$dir" || continue
  # Do something with $dir...
done

如何进入各个目录并执行命令?

走过海棠暮 2024-12-12 00:45:02

我有几个评论:

  • 盐应该是随机的并且每个用户都是唯一的,但是它们不必是哈希摘要。盐的想法只是使每个用户的哈希摘要都是唯一的,以抵抗字典攻击和彩虹表攻击。无论盐的长度如何,盐都不会增加哈希摘要算法的强度。

  • DES 使用 12 位作为盐。更新的 UNIX 密码系统使用更多,最多 128 位。

  • 如果您想要更强的密码,请考虑使用 bcryptPBKDF2

  • FWIW,无论输入的长度如何,SHA-512 哈希摘要(编码为十六进制数字)始终恰好是 128 个字符。所以我会使用 CHAR(128) 而不是 VARCHAR(128)。使用 BINARY(2) 或 BINARY(3) 作为盐。

I have several comments:

  • Salts should be random and unique per user, but they don't have to be a hash digest. The idea of a salt is just to make the hash digest unique per user to resist dictionary attacks and rainbow table attacks. The salt doesn't add to the strength of the hash digest algorithm, regardless of the salt's length.

  • DES uses 12 bits for the salt. Updated UNIX password systems use more, up to 128 bits.

  • If you want stronger passwords, consider using bcrypt or PBKDF2.

  • FWIW, a SHA-512 hash digest (encoded as hex digits) is always exactly 128 characters, regardless of the length of the input. So I'd use CHAR(128) instead of VARCHAR(128). Use BINARY(2) or BINARY(3) for the salt.

我的密码盐应该有多大?

走过海棠暮 2024-12-11 23:00:16

Delay() 的另一个副作用:它似乎禁用了隐藏(或淡出等)被延迟的对象的能力,直到延迟结束。

例如,我设置了以下代码(也许 stackoverflow 开发人员会识别 css 名称......)来隐藏“div”:

 $j(document).ready(function(){
   var $messageDiv = $j("<div>").addClass('fading_message')
       .text("my alert message here").hide();
   var $closeSpan = $j("<span>").addClass('notify_close').text("x");
   $closeSpan.click(function() {$j(this).parent().slideUp(400);});
   $messageDiv.append($closeSpan);
   $j('.content_wrapper_div').prepend($messageDiv);
   $messageDiv.fadeTo(500, .9).delay(5000).fadeTo(800,0);
 });

单击跨度(位于“div”中)中的“x”确实会触发关闭点击功能(我在那里测试了警报),但 div 没有按照指示向上滑动。但是,如果我用以下内容替换最后一行:

     $messageDiv.fadeTo(500, .9);

..然后它确实起作用 - 当我单击“x”时,周围的 div 向上滑动并离开。似乎 $messageDiv 上的“delay()”函数的后台运行“锁定”了该对象,因此在延迟完成之前尝试关闭它的单独机制无法执行此操作。

Another side effect of delay(): it seems to disable the ability to hide (or fadeOut, etc) the objecting being delayed, until the delay is over.

For example, I set up the following code (perhaps a stackoverflow developer will recognize the css names....) to hide a 'div':

 $j(document).ready(function(){
   var $messageDiv = $j("<div>").addClass('fading_message')
       .text("my alert message here").hide();
   var $closeSpan = $j("<span>").addClass('notify_close').text("x");
   $closeSpan.click(function() {$j(this).parent().slideUp(400);});
   $messageDiv.append($closeSpan);
   $j('.content_wrapper_div').prepend($messageDiv);
   $messageDiv.fadeTo(500, .9).delay(5000).fadeTo(800,0);
 });

Clicking the "x" that's in the span (that's in the 'div') did fire off the click function (I tested with an alert in there), but the div didn't slideUp as directed. However, If I replace the last line with this:

     $messageDiv.fadeTo(500, .9);

..then it did work - when I clicked the "x", the surrounding div slideUp and and away. It seems as if the background running of the "delay()" function on the $messageDiv "locked" that object, so that a separate mechanism trying to close it couldn't do so until the delay was done.

.delay() 和 .setTimeout()

走过海棠暮 2024-12-11 21:00:19

对于 MakeNSISW 2.3,仅输入 Icon

Icon "MyIcon.ico"

https://nsis.sourceforge.io/Reference/图标

With MakeNSISW 2.3 only type Icon

Icon "MyIcon.ico"

https://nsis.sourceforge.io/Reference/Icon

如何替换 NSIS 安装程序中的默认徽标?

走过海棠暮 2024-12-11 20:46:16

不,你不能这样做。
您只能使用 javascript 执行 window.print() 并显示窗口。

为什么不能:因为安全。

No, you cannot do it.
You can only do window.print() with javascript and it displays the window.

Why you cannot: because safety.

php 或 javascript 自动打印

走过海棠暮 2024-12-11 19:19:57

使用 关系 查找例如:

foo_list = Foo.objects.filter(params).values('field','bar__barField','bar__barField2')

这将在一个查询中完成这项工作,并且结果集也将包含所需的字段。

Use relationship look up's eg:

foo_list = Foo.objects.filter(params).values('field','bar__barField','bar__barField2')

This will do the job in one query and the result set will have the required fields as well.

如何一次性获取所有 django 外键对象?

走过海棠暮 2024-12-11 14:35:39

C++03 标准说(强调我的):

8.3.5.2

参数声明子句确定可以使用的参数
调用函数时指定及其处理。 [笔记:
参数声明子句用于转换参数
在函数调用中指定;见 5.2.2。 ] 如果
参数声明子句为空,该函数不接受
论据

这意味着,如果您与编译器交谈,这只是一个品味问题。

如果您正在编写将被其他人阅读的代码,那么 C++ 的处理方式是:

void foo();

另一种形式仅出于与 C 的兼容性原因而保持有效,其中两个签名之间存在差异。

The C++03 standard says (emphasis mine):

8.3.5.2

The parameter-declaration-clause determines the arguments that can be
specified, and their processing, when the function is called. [Note:
the parameter-declaration-clause is used to convert the arguments
specified on the function call; see 5.2.2. ] If the
parameter-declaration-clause is empty, the function takes no
arguments
.

This means that if you are talking to the compiler it's just a matter of taste.

If you are writing code that will be read by others, then the C++ way of doing things is

void foo();

The other form remains valid only for reasons of compatibility with C, where there was a difference among the two signatures.

为什么要在方法参数列表中添加void

走过海棠暮 2024-12-11 10:50:51
  1. 打开 Xcode。
  2. 单击项目文件(项目导航器中的第一项)
  3. 选择一个适当的目标
  4. 打开构建阶段
  5. 选择将二进制文件与库链接< /code>
  6. 添加您的
  1. Open Xcode.
  2. Click on project file (the first item in Project navigator)
  3. Select one of appropriate target
  4. Open Build Phases
  5. Select Link Binary With Libraries
  6. Add your library

如何在我的应用程序中添加静态创建的库..?

走过海棠暮 2024-12-11 10:29:04

根据 PHP 文档date_parse_from_format 仅从 PHP 5.3 起可用。

您可以尝试使用此替代方案,发布在SO: PHP PHP 5.2 中的 date_parse_from_format( ) 替代方案

According to the PHP documentation, date_parse_from_format is available since PHP 5.3 only.

You can try with this alternative, posted in SO: PHP date_parse_from_format( ) alternative in PHP 5.2

致命错误:调用未定义的函数 date_parse_from_format()

走过海棠暮 2024-12-11 09:51:40

要使其正常工作,您可以进行的最简单的更改是

function pagina_ophalen(pagina){    
    $.get('paginas/' + pagina + '.html',
          { t = new Date().getTime() },    // ADD THIS
          function(data){
            $('#inlaadcontent').css('display','none');
            $('#inlaadcontent').html(data);
            $('#inlaadcontent').fadeIn("slow");
          });
}

有什么区别?

您的浏览器正在缓存 AJAX 请求的结果,因为 URL 每次都是相同的。通过添加可变的查询参数(?t=xxxxxxx,基于当前时间戳),您可以使浏览器将每个请求视为新请求并再次获取页面,而不是使用缓存的结果。

如果您看一下 jQuery.ajax 函数(其中 get 只是一个以方便为目标的子集),您将看到有一个可以设置的 cache 选项。如果设置为 false,这正是我上面描述的。

The simplest change you can make to get this working is

function pagina_ophalen(pagina){    
    $.get('paginas/' + pagina + '.html',
          { t = new Date().getTime() },    // ADD THIS
          function(data){
            $('#inlaadcontent').css('display','none');
            $('#inlaadcontent').html(data);
            $('#inlaadcontent').fadeIn("slow");
          });
}

What's the difference?

Your browser is caching the result of the AJAX request because the URL is the same each time. By adding a query parameter that is variable (?t=xxxxxxx, based on the current timestamp) you make the browser consider each request as a new one and fetch the page again instead of using the cached result.

If you take a look at the jQuery.ajax function (of which get is simply a convenience-targeted subset), you will see that there is a cache option you can set. This does exactly what I described above if set to false.

无法使用 jQuery.Get() 方法刷新

走过海棠暮 2024-12-11 08:55:15

在 jQuery 中,使用 html 语法:

td.append("<audio>");

尖括号告诉 jQuery 创建一个新元素。我不确定 jQuery 在幕后使用什么方法(无论是 innerHTML 还是 doc.createElement()),但非 jQuery 方法是:

var audioElement = td.appendChild(document.createElement("audio"));

使用 < code>new Audio() 语法,非 jQuery 代码类似:

var audioElement = td.appendChild(new Audio);

编辑: 我刚刚测试过,jQuery 在 Chrome 中似乎没有问题:

td.append(new Audio());

这是一个 jQuery 演示: <一href="http://jsfiddle.net/gilly3/WRqyM/1" rel="nofollow">http://jsfiddle.net/gilly3/WRqyM/1

更新:IE9 似乎没有去工作。 :-( 除非 audiosrc,否则 IE9 不会显示。我已经更新了 jsfiddle。

The way you do it in jQuery, you use html syntax:

td.append("<audio>");

The angle brackets tell jQuery to create a new element. I'm not sure what method jQuery uses behind the scenes (whether innerHTML or doc.createElement()), but the non-jQuery approach would be:

var audioElement = td.appendChild(document.createElement("audio"));

To use the new Audio() syntax, the non-jQuery code is similar:

var audioElement = td.appendChild(new Audio);

Edit: I just tested, and jQuery seems to have no problem with this in Chrome:

td.append(new Audio());

Here's a jQuery demo: http://jsfiddle.net/gilly3/WRqyM/1

Update: IE9 doesn't seem to work. :-( IE9 just doesn't show up unless the audio has a src. I've updated the jsfiddle.

如何将视频/音频对象添加到DOM?

走过海棠暮 2024-12-11 07:33:33

在“重构方法的快速摘要”中找到了这一点,

// Here are some ways to avoid taking account of generated methods.
!( NameIs "InitializeComponent()" OR
   // NDepend.CQL.GeneratedAttribute is defined in 
   // the redistributable assembly $NDependInstallDir$\Lib\NDepend.CQL.dll
   // You can define your own attribute to mark "Generated".
   HasAttribute "OPTIONAL:NDepend.CQL.GeneratedAttribute") 

但这并不能解决修改每个 CQL 查询以确保它们都忽略生成的代码的需要。

Found this in the "Quick summary of methods to refactor"

// Here are some ways to avoid taking account of generated methods.
!( NameIs "InitializeComponent()" OR
   // NDepend.CQL.GeneratedAttribute is defined in 
   // the redistributable assembly $NDependInstallDir$\Lib\NDepend.CQL.dll
   // You can define your own attribute to mark "Generated".
   HasAttribute "OPTIONAL:NDepend.CQL.GeneratedAttribute") 

But that doesn't address the need to modify every CQL query to ensure they all ignore the generated code.

是否可以从 NDepend 分析中排除整个命名空间?

走过海棠暮 2024-12-11 05:41:54

答案是将event.preventDefault()添加到mouseDown事件中。

const button = document.getElementById('boldFormat')

button.addEventListener('mousedown', (event) => {
  event.preventDefault() // prevent loss of focus
  document.execCommand('bold', false)
})

出现此问题的原因是您正在侦听 click 事件,该事件导致 contentEditable 元素失去焦点;无论您是否运行 preventDefault

The answer is to add event.preventDefault() to the mouseDown event.

const button = document.getElementById('boldFormat')

button.addEventListener('mousedown', (event) => {
  event.preventDefault() // prevent loss of focus
  document.execCommand('bold', false)
})

The problem occurred because the you are listening to the click event which causes the contentEditable element to lose focus; regardless of whether you run preventDefault or not.

当用户在可内容编辑元素之外单击时,如何避免失去对该元素的焦点?

走过海棠暮 2024-12-11 03:50:36

我推荐使用 twython 作为 Python Twitter 库。它会定期维护,考虑到 Twitter 更改其 API 的频率,这是一个有用的属性。

编辑:请参阅 tweetstream 作为过滤功能的简单流 API 实现。

I recommend twython for a Python Twitter library. It is regularly maintained, a useful property considering how often Twitter changes its API.

EDIT: See tweetstream for a simple streaming API implementation which as filtering capabilities.

Python Twitter 流 API - 仅限关注的用户

走过海棠暮 2024-12-11 02:17:55

对于占位符垂直居中:

input::placeholder{
position:relative !important;
top:50% !important;
transform:translateY(-50%) !important; 
}

For vertically centering the placeholder:

input::placeholder{
position:relative !important;
top:50% !important;
transform:translateY(-50%) !important; 
}

居中 HTML 输入文本字段占位符

更多

推荐作者

小瓶盖

文章 0 评论 0

wxsp_Ukbq8xGR

文章 0 评论 0

1638627670

文章 0 评论 0

仅一夜美梦

文章 0 评论 0

夜访吸血鬼

文章 0 评论 0

近卫軍团

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文