鹿港巷口少年归

文章 评论 浏览 30

鹿港巷口少年归 2025-02-20 19:23:58

就我而言,由于脚本不会更改,因此我可以使用哈希(Hash)将其进行白色。

因此,最后我可以这样工作:

  • link 标签中删除 onload 属性:
<link id="styles" rel="preload" as="style" href="/styles.css" />
  • load> load 侦听器在脚本 app.html 中的标签:
<script>
const styles = document.getElementById('styles');
window.addEventListener('load', (e) => {
    styles.setAttribute('rel', 'stylesheet');
});
</script>
  • 生成上述脚本的哈希,例如用此工具
kit: {
    ...,
    csp: {
      mode: "auto",
      directives: {
        "script-src": [
          "self",
          "sha256-...",
        ],
      },
    },
  },

href 使用CSP的异步加载和安全性。

In my case since the script will not change I can use a hash to whitelist it.

So in the end I can make it work like this:

  • Remove the onload attribute from the link tag:
<link id="styles" rel="preload" as="style" href="/styles.css" />
  • Put the load listener in a script tag in app.html:
<script>
const styles = document.getElementById('styles');
window.addEventListener('load', (e) => {
    styles.setAttribute('rel', 'stylesheet');
});
</script>
  • Generate the hash of the above script, for example with this tool, and add it to the whitelist:
kit: {
    ...,
    csp: {
      mode: "auto",
      directives: {
        "script-src": [
          "self",
          "sha256-...",
        ],
      },
    },
  },

This way I get the benefits of speed with async loading and security with csp.

Sveltekit异步负载样式具有严格的CSP(没有不安全的内线)%sveltekit.nonce%?

鹿港巷口少年归 2025-02-19 08:52:45

在这种情况下,错误消息有点令人困惑。 val var 之间的区别在于 val 意味着有一个getter,而 var 表示有一个getter和二传手。要修复您的代码,您需要为设置器添加实现:

var nameHash
    get() = name.hashCode()
    set(hash: Int) { ... }

尽管在这种情况下,我认为这没有太多意义。我们无法设置 name 的哈希代码值。

The error message is a little confusing in this case. The difference between val and var is that val means there is a getter while var means there is a getter and a setter. To fix your code you need to add an implementation for the setter:

var nameHash
    get() = name.hashCode()
    set(hash: Int) { ... }

Although, in this case I don't think it makes too much sense. We can't set the hash code value of the name.

Kotlin编译器如何知道Val应该是属性还是功能

鹿港巷口少年归 2025-02-19 03:51:31

您可以尝试将 uivisualeffectView 放在视频供稿之上,然后将屏蔽现金PAPAPELAYER添加到该 uivisaleffectView 。我不知道那是否有效。

uivisualeffectView 上的文档说:

使用uivisualeffectView类时,请避免小于1的alpha值。创建部分透明的视图会导致系统组合视图和所有相关的子视图,并在屏幕外渲染通行证中组合所有相关的子视图。为了看起来正确,需要将uivisualeffectView对象组合为它们放在顶部的内容的一部分。将alpha设置为视觉效果视图或其任何监督的任何效果都会导致许多效果看起来不正确或根本不显示。

我不知道在视觉效果视图上使用掩码层是否会导致相同的渲染问题。您必须尝试。 (并且一定要在各种不同的硬件上尝试,因为渲染性能在不同版本的苹果芯片组之间有很大变化。)

您还可以尝试使用装有视觉哈希的形状层或“像素化的”图案而不是形状层而不是模糊。这将更快,可能会更可靠。

请注意,面部检测往往有点跳动。它可能会掉落几帧,或者在快速平底锅上滞后或更改场景。如果您试图将人们的面孔隐藏在现场饲料中以寻求隐私,则可能并不可靠。只需要几个不张开的框架才能揭示某人的身份。

You could try placing a UIVisualEffectView on top of your video feed, and then adding a masking CAShapeLayer to that UIVisualEffectView. I don't know if that would work or not.

The docs on UIVisualEffectView say:

When using the UIVisualEffectView class, avoid alpha values that are less than 1. Creating views that are partially transparent causes the system to combine the view and all the associated subviews during an offscreen render pass. UIVisualEffectView objects need to be combined as part of the content they are layered on top of in order to look correct. Setting the alpha to less than 1 on the visual effect view or any of its superviews causes many effects to look incorrect or not show up at all.

I don't know if using a mask layer on a visual effect view would cause the same rendering problems or not. You'd have to try it. (And be sure to try it on a range of different hardware, since the rendering performance varies quite a bit between different versions of Apple's chipsets.)

You could also try using a shape layer filled with visual hash or a "pixellated" pattern instead of blurring. That would be faster and probably render more reliably.

Note that face detection tends to be a little jumpy. It might drop out for a few frames, or lag on quick pans or change of scene. If you're trying to hide people's faces in a live feed for privacy, it might not be reliable. It would only take a few un-blurred frames for somebody's identity to be revealed.

视觉套件中的脸部检测模糊

鹿港巷口少年归 2025-02-19 03:43:43

您可以使用自定义JSON转换器如果您使用的是 system.text.json ,并且有一个示例,说明如何做

public class ComponentJsonConverter : JsonConverter<Component>
{
  public override Component Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 
  {
    var type = JsonDocument.Parse(reader.GetRawText())
      .RootElement.GetProperty("PartType").GetString();
    if (type == "Engine")
      return JsonSerializer.DeserializeAsync<Engine>(reader.GetRawText());
    ...
  }
    
  public override void Write(Utf8JsonWriter writer, Component value, JsonSerializerOptions options) =>
    writer.WriteStringValue(JsonSerializer.Serialize(value, options));
}

you can use Custom Json Converter if you are using system.text.json and there is an example of how you can do it

public class ComponentJsonConverter : JsonConverter<Component>
{
  public override Component Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 
  {
    var type = JsonDocument.Parse(reader.GetRawText())
      .RootElement.GetProperty("PartType").GetString();
    if (type == "Engine")
      return JsonSerializer.DeserializeAsync<Engine>(reader.GetRawText());
    ...
  }
    
  public override void Write(Utf8JsonWriter writer, Component value, JsonSerializerOptions options) =>
    writer.WriteStringValue(JsonSerializer.Serialize(value, options));
}

序列化的儿童

鹿港巷口少年归 2025-02-19 03:10:13

在显示任务窗格之前,请检查 mailItem.Sent 属性是错误的。

Check that MailItem.Sent property is false before displaying your task pane.

VSTO OUTLOOK:仅在撰写,回复和向前的Windows中显示自定义Taskpane

鹿港巷口少年归 2025-02-19 00:03:15

一种方法是首先从行中收集所有相关ID,并且仅进行1 dB查询,例如:

var toprint_ids = new List<long>();
for (int i = 0; i <= DgvSale.Rows.Count - 1; i++)
{
    if (Convert.ToBoolean(DgvSale.Rows[i].Cells[8].Value) == true)
    {
        var itm_id = Convert.ToInt64(row1.Cells[0].Value);
        ids.Add(itm_id);
    }
}

if (toprint_ids.Count == 0)
    return;

tblRpt1 = db.readData("SELECT [Order_ID] as 'رقم الفاتورة',talb_ID as 'طلب',[Cust_Name] as 'اسم العميل',Products.Pro_Name as 'المنتج',Products.Group_ID as 'قسم',Products_Group.Group_Name as 'اسم القسم',[Sales_Detalis].[Qty] as 'الكمية',[Price] as 'السعر',[User_Name] as 'الكاشير',[Date] as 'التاريخ',[Unit] as 'الوحدة',[Sales_Detalis].Tax_Value as 'الضريبة',Price_Tax as 'السعر بعد الضريبة',[typetalab] as 'نوع الطلب',[priceservic] as 'خدمة',[shiftname] as 'شيفت',notes as 'ملاحظات',shiftnum as 'شيفت رقم',Print_Group.Print_Name,Print_Group.Name_Group  FROM [dbo].[Sales_Detalis] , Products,Products_Group,Print_Group where Products.Pro_ID = Sales_Detalis.Pro_ID and Products.Pro_ID in (" + string.Join(",", toprint_ids) + ") and Order_ID = " + id + "  and Products.Group_ID = Products_Group.Group_ID and Print_Group.Name_Group=Products.Group_ID  ORDER BY Order_ID ASC", "");


if (Properties.Settings.Default.SalePrintKind == "8CM")
{
    devOrderSales2 rpt = new devOrderSales2() { DataSource = tblRpt1, DataMember = "OrderSales2" };
    rpt.DataSource = tblRpt1;
    rpt.Parameters["ID1"].Value = id;
    rpt.PrinterName = Properties.Settings.Default.PrinterNameSteker;
    rpt.xrTableCell8.Visible=true;
    if (Properties.Settings.Default.saleprintauto == "0")
    {
        rpt.Print();
    }
    else if (Properties.Settings.Default.saleprintauto == "1")
    {
        rpt.ShowPreviewDialog();
    }
}

请注意查询中的更改: in(“ + string.join(“,”,toprint_ids)) +“)
另外,如果您的行有非数字ID(例如GUIDS),则需要将列表更改为 list&lt; string&gt; ,并且还将查询更改为in(''''in('') + string.join(“','”,toprint_ids) +“')

One way is to first collect all the relevant IDs from the rows, and only do 1 db query, eg:

var toprint_ids = new List<long>();
for (int i = 0; i <= DgvSale.Rows.Count - 1; i++)
{
    if (Convert.ToBoolean(DgvSale.Rows[i].Cells[8].Value) == true)
    {
        var itm_id = Convert.ToInt64(row1.Cells[0].Value);
        ids.Add(itm_id);
    }
}

if (toprint_ids.Count == 0)
    return;

tblRpt1 = db.readData("SELECT [Order_ID] as 'رقم الفاتورة',talb_ID as 'طلب',[Cust_Name] as 'اسم العميل',Products.Pro_Name as 'المنتج',Products.Group_ID as 'قسم',Products_Group.Group_Name as 'اسم القسم',[Sales_Detalis].[Qty] as 'الكمية',[Price] as 'السعر',[User_Name] as 'الكاشير',[Date] as 'التاريخ',[Unit] as 'الوحدة',[Sales_Detalis].Tax_Value as 'الضريبة',Price_Tax as 'السعر بعد الضريبة',[typetalab] as 'نوع الطلب',[priceservic] as 'خدمة',[shiftname] as 'شيفت',notes as 'ملاحظات',shiftnum as 'شيفت رقم',Print_Group.Print_Name,Print_Group.Name_Group  FROM [dbo].[Sales_Detalis] , Products,Products_Group,Print_Group where Products.Pro_ID = Sales_Detalis.Pro_ID and Products.Pro_ID in (" + string.Join(",", toprint_ids) + ") and Order_ID = " + id + "  and Products.Group_ID = Products_Group.Group_ID and Print_Group.Name_Group=Products.Group_ID  ORDER BY Order_ID ASC", "");


if (Properties.Settings.Default.SalePrintKind == "8CM")
{
    devOrderSales2 rpt = new devOrderSales2() { DataSource = tblRpt1, DataMember = "OrderSales2" };
    rpt.DataSource = tblRpt1;
    rpt.Parameters["ID1"].Value = id;
    rpt.PrinterName = Properties.Settings.Default.PrinterNameSteker;
    rpt.xrTableCell8.Visible=true;
    if (Properties.Settings.Default.saleprintauto == "0")
    {
        rpt.Print();
    }
    else if (Properties.Settings.Default.saleprintauto == "1")
    {
        rpt.ShowPreviewDialog();
    }
}

Please notice the change in the query as well: in (" + string.Join(",", toprint_ids) + ")
Also if you have non-numeric IDs for your rows (eg Guids), then you need to change the list to a List<string> and also change your query to like in ('" + string.Join("','", toprint_ids) + "')

如何仅在网格视图中打印指定的行

鹿港巷口少年归 2025-02-18 13:50:34

在C代码中:

auto magic = (1ULL<<32)/test_divisor;

我们在 Magic 中获得了一个整数值,因为 code>(1ull&lt;&lt; 32)&amp; test_divisor 是整数。
该算法需要在某些条件下增加 Magic ,这是下一个条件语句。

现在,乘法还提供了整数:

auto answer1 = (a*magic) >> 32;
auto answer2 = (b*magic) >> 32;

C代码完成了!

在JS代码中:

所有变量均为 var ;没有数据类型!
没有整数部门,没有整数乘法!
位操作并不容易,也不适合在此算法中使用。
数字数据是通过编号&amp; bigint不像C INT 无符号长

因此,该算法正在使用循环迭代添加并比较“划分”是否已在最近的整数内发生。

这两个版本都试图实现相同的算法。两者都“应该”给出相同的答案,但是JS版本是“ Buggy”&amp;非标准。
虽然JS版本有很多问题,但我将

  1. 在循环中仅突出显示3:

    ,而在尝试获得2的最佳功率时,我们有这两个陈述:

      p = p + 1;
    Q1 = 2*Q1; //更新Q1 = 2 ** p/| nc |。
     

    基本上是在增加计数器&amp;将数字乘以2,这是C ++中的左移。 C ++版本不需要此Rigmarole。

  2. 条件在 || 的RHS上具有2个平等比较:

      while(q1&lt; delta ||(q1 == delta&amp;&amp; r1 == 0))
     

    但是,这两个在浮点计算中都是错误的[[EG检查 Math.sqrt(2)*Math.sqrt(0.5)== 1 :即使这一定是正确的,它也是如此因此,条件基本上是 || 的LHS,因为RHS始终是false。

  3. JS版本仅返回一个变量 mag ,但是用户应该获得(&amp; use)甚至变量 shift> shift ,它由全局变量访问给出。不一致&amp;不好!<​​/p>

比较,我们看到C版本更为标准化,但要点是不使用 auto ,而是使用 int64_t ,带有已知数量的位。

In the C code:

auto magic = (1ULL<<32)/test_divisor;

We get an integer value in magic because both (1ULL<<32) & test_divisor are integers.
The algorithms requires incrementing magic on certain conditions, which is the next conditional statement.

Now, multiplication also gives integers:

auto answer1 = (a*magic) >> 32;
auto answer2 = (b*magic) >> 32;

C CODE is DONE!

In the JS code:

All variables are var; no data types!
No integer division, no integer multiplication!
Bitwise operations are not easy and not suitable to use in this algorithm.
Numeric data is via number & BigInt which are not like C int or unsigned long long.

Hence the algorithm is using loops to iteratively add and compare whether "Division & Multiplication" has occurred to within the nearest integer.

Both versions try to implement the same algorithm. Both "should" give the same answer, but the JS Version is "buggy" & non-standard.
While there are many issues with the JS version, I will highlight only 3:

  1. In the loop, while trying to get the best power of 2, we have these two statements:

    p = p + 1;
    q1 = 2*q1;                // Update q1 = 2**p/|nc|.
    

    It is basically incrementing a counter & multiplying a number by 2, which is a left shift in C++. The C++ version will not require this rigmarole.

  2. The while condition has 2 equality comparisons on RHS of ||:

    while (q1 < delta || (q1 == delta && r1 == 0))
    

    But both these will be false in floating-point calculations [[ eg check Math.sqrt(2)*Math.sqrt(0.5) == 1: even though this must be true, it will almost always be false ]] hence the while condition is basically the LHS of ||, because RHS will always be false.

  3. The JS version returns only one variable mag but user is supposed to get (& use) even variable shift which is given by global variable access. Inconsistent & BAD!

Comparing, we see that the C version is more standard, but the point is to not use auto but use int64_t with known number of bits.

为什么JavaScript部门在乘法代码中有一个循环?

鹿港巷口少年归 2025-02-18 13:28:58

如果您想支持老年人,则可以使用包含的回调轻松绑定,例如:

const create_plan_agreement = (req, res) => {
  // some code
  var client_id = req.auth.client_id;
  third_party.plan_agreement.create({}, function(params, from, create) {
    update_plan_agreement(params, from, create, client_id)
  });
};

const update_plan_agreement = (err, plan_document, client_id) => {
  /* 
      The third-party `third_party.plan_agreement.create` function passes the first 
      two parameters and somehow we need to add the client_id 
  */
  console.log('client plan activated');
  active_client_plan(plan_document, client_id);
};

If you want to support older people, you can easily bind using a containing callback, like this:

const create_plan_agreement = (req, res) => {
  // some code
  var client_id = req.auth.client_id;
  third_party.plan_agreement.create({}, function(params, from, create) {
    update_plan_agreement(params, from, create, client_id)
  });
};

const update_plan_agreement = (err, plan_document, client_id) => {
  /* 
      The third-party `third_party.plan_agreement.create` function passes the first 
      two parameters and somehow we need to add the client_id 
  */
  console.log('client plan activated');
  active_client_plan(plan_document, client_id);
};

在JavaScript中为回调函数添加额外的参数

鹿港巷口少年归 2025-02-18 11:25:57

自我就像当前对象名称或类的实例一样。

# Self explanation.


 class classname(object):

    def __init__(self,name):

        self.name=name
        # Self is acting as a replacement of object name.
        #self.name=object1.name

   def display(self):
      print("Name of the person is :",self.name)
      print("object name:",object1.name)


 object1=classname("Bucky")
 object2=classname("ford")

 object1.display()
 object2.display()

###### Output 
Name of the person is : Bucky
object name: Bucky
Name of the person is : ford
object name: Bucky

self is acting as like current object name or instance of class .

# Self explanation.


 class classname(object):

    def __init__(self,name):

        self.name=name
        # Self is acting as a replacement of object name.
        #self.name=object1.name

   def display(self):
      print("Name of the person is :",self.name)
      print("object name:",object1.name)


 object1=classname("Bucky")
 object2=classname("ford")

 object1.display()
 object2.display()

###### Output 
Name of the person is : Bucky
object name: Bucky
Name of the person is : ford
object name: Bucky

“自我”参数的目的是什么?为什么需要它?

鹿港巷口少年归 2025-02-17 23:12:31

对于两个参数,我们可以收集所有基准时间安排,以 factials.partials.partial 和 N perpplot

import perfplot
from functools import partial

res = []
for f in range(5,100,20):
    arr = np.random.randint(0, 2, (f, f))
    g = perfplot.bench(
        setup=lambda n: n,
        kernels=[partial(scipy_zoom, arr),
                 partial(numpy_rep, arr)],
        labels=['zoom','numpy'],
        n_range=[2,3,4,5,6,7,8,9,10],
        equality_check=False # results are not equal!
    )
    res.append(g)

,并绘制了2D行绘图层的3D图。

from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from cycler import cycler


fig = plt.figure(figsize=(10,8))
ax = fig.add_subplot(111, projection='3d')
cc = cycler(color=list('rg'))

for i, g in zip(range(5,100,20)[::-1],res[::-1]):  # plot from back to front
    ax.plot(g.n_range,g.timings_s.T, i, zdir='y', alpha=0.8)

plt.rc('axes', prop_cycle=cc)
ax.set_xlabel('n')
ax.set_ylabel('f')
ax.set_zlabel('seconds')
ax.legend(g.labels)
plt.show()

输出

For two arguments we can collect all benchmark timings, setting the range of f for arr size with functools.partial and the range of n within perfplot

import perfplot
from functools import partial

res = []
for f in range(5,100,20):
    arr = np.random.randint(0, 2, (f, f))
    g = perfplot.bench(
        setup=lambda n: n,
        kernels=[partial(scipy_zoom, arr),
                 partial(numpy_rep, arr)],
        labels=['zoom','numpy'],
        n_range=[2,3,4,5,6,7,8,9,10],
        equality_check=False # results are not equal!
    )
    res.append(g)

and plot a 3D graph of 2D line plot layers.

from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from cycler import cycler


fig = plt.figure(figsize=(10,8))
ax = fig.add_subplot(111, projection='3d')
cc = cycler(color=list('rg'))

for i, g in zip(range(5,100,20)[::-1],res[::-1]):  # plot from back to front
    ax.plot(g.n_range,g.timings_s.T, i, zdir='y', alpha=0.8)

plt.rc('axes', prop_cycle=cc)
ax.set_xlabel('n')
ax.set_ylabel('f')
ax.set_zlabel('seconds')
ax.legend(g.labels)
plt.show()

Output

results

perpplot比较多个函数的性能与多个参数(多个)

鹿港巷口少年归 2025-02-17 20:21:45

FSGSBASE指令需要操作系统以及硬件的支持。操作系统必须意识到,可以通过用户代码更改基本寄存器,而无需通知操作系统。 OSS可能已经假设只有在用户进行明确的系统调用时才能更改寄存器。 CR4中有一些确定是否允许非特权代码执行这些说明,默认情况下,它是不设置的。这个想法是,只有包含适当支持的操作系统才能实现这一点。参见 Intel的指南有关更多详细信息。

在Linux中,在内核版本5.9中添加了此支持( Arch_prctl 系统调用以请求对FS或GS基本寄存器的更新。否则升级您的内核 / OS。

ELF AUX VECTOR中有一些程序可以在运行时测试,以确定FSGSBASE指令是否可用。参见在“ FSGSBASE指令启用”下。

The FSGSBASE instructions require support from the operating system as well as the hardware. The OS has to be aware that the base registers could be changed by user code without informing the OS; older OSes might have assumed that the registers could only be changed when the user made an explicit system call. There is a bit in CR4 that determines whether unprivileged code is allowed to execute these instructions, and by default, it is unset. The idea is that only an OS that contains the appropriate support will enable this bit. See Intel's guidelines for more details.

In Linux, this support was added in kernel version 5.9 (changelog). Per your comment, you are using an older kernel, so you cannot use these instructions, and must fall back to using the arch_prctl system call to request an update to the FS or GS base registers. Or else upgrade your kernel / OS.

There is a bit in the ELF AUX vector that your program can test at runtime to determine whether the FSGSBASE instructions are usable. See https://www.kernel.org/doc/html/latest/x86/x86_64/fsgs.html under "FSGSBASE instructions enablement".

当Skylake具有FSGSBASE时,为什么我使用__builtin_ia32_wrfsbase64获得非法指令?

鹿港巷口少年归 2025-02-17 11:15:09

尝试一下

df |> group_by(Session) |> 
mutate(Activity = case_when(Click == "Enter" ~ Page , 
lag(Page) == Page ~ Click)) |> select(Session , Activity)

Try this

df |> group_by(Session) |> 
mutate(Activity = case_when(Click == "Enter" ~ Page , 
lag(Page) == Page ~ Click)) |> select(Session , Activity)

基于R中的两列填充一列

鹿港巷口少年归 2025-02-17 03:44:41

您的代码:

$('.clicker').click(function() {
    $('.shop_container').find('.wrapper');  // => no action, no effect
    $('.wrapper').toggleClass('show'); // => get all elements whose class is `wrapper` , add class `show` to those elements (both elements are added)
    $('.shop_container').find('.wrapper.show').removeClass('show'); // then remove the `show` class on elements whose class is `show` and `wrapper`
});

结果,您将 show 类添加到具有类包装器的所有DIV标签,然后再次删除它们。

您可以使用数据集与:

$('.clicker').click(function() {
  let content = $(this).data('content')
  $('.wrapper.' + content).toggleClass('show').siblings('.wrapper').removeClass('show')
});
.wrapper {
  width: 10vw;
  height: 10vh;
  border: solid 1px #ccc;
  margin: 5px;
  display: none;
}

.wrapper.show {
  display: block;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div class="shop_container">
  <button class="clicker" data-content='first-content'>
  First
  </button>
  <button class="clicker" data-content='second-content'>
  Second
  </button>
  <div class="wrapper first-content">
    Content first
  </div>
  <div class="wrapper second-content">
    Content second
  </div>
</div>

Your code :

$('.clicker').click(function() {
    $('.shop_container').find('.wrapper');  // => no action, no effect
    $('.wrapper').toggleClass('show'); // => get all elements whose class is `wrapper` , add class `show` to those elements (both elements are added)
    $('.shop_container').find('.wrapper.show').removeClass('show'); // then remove the `show` class on elements whose class is `show` and `wrapper`
});

As a result, you add the show class to all the div tags that have the class wrapper and then remove them again.

You can use dataset same as :

$('.clicker').click(function() {
  let content = $(this).data('content')
  $('.wrapper.' + content).toggleClass('show').siblings('.wrapper').removeClass('show')
});
.wrapper {
  width: 10vw;
  height: 10vh;
  border: solid 1px #ccc;
  margin: 5px;
  display: none;
}

.wrapper.show {
  display: block;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div class="shop_container">
  <button class="clicker" data-content='first-content'>
  First
  </button>
  <button class="clicker" data-content='second-content'>
  Second
  </button>
  <div class="wrapper first-content">
    Content first
  </div>
  <div class="wrapper second-content">
    Content second
  </div>
</div>

jQuery Toggle类问题

鹿港巷口少年归 2025-02-17 01:47:55

此行为是由数据组特征引起的。您需要为区域系列禁用它:

  series: [...,
    {
      type: 'area',
      dataGrouping: {
        enabled: false
      },
      ...
    }
  ]

实时演示:

​> https://api.highcharts.com/highstock/series.area.datagrouping

docs: https://www.highcharts.com/docs/stock/data-grouping

This behaviour is caused by the data-grouping feature. You need to disable it for the area series:

  series: [...,
    {
      type: 'area',
      dataGrouping: {
        enabled: false
      },
      ...
    }
  ]

Live demo: http://jsfiddle.net/BlackLabel/6jz1cpvs/

API Reference: https://api.highcharts.com/highstock/series.area.dataGrouping

Docs: https://www.highcharts.com/docs/stock/data-grouping

更改日期范围时的情节区域奇怪行为

鹿港巷口少年归 2025-02-16 16:49:29

您需要插入计数器,以便每次完成一个问题时,计数器都会由1添加。然后,从数组中获取确切的对象。我在下面显示了一个代码示例。希望这有帮助!

int counter = 0;
/*After question answered*/
counter++;
/*This will allow to access the correct set of questions*/
quizQuestions[counter];

You would need to insert a counter so that every time you complete a question, the counter is added by 1. Then, take the exact object from the array. I have shown a code example below. Hope this helps!

int counter = 0;
/*After question answered*/
counter++;
/*This will allow to access the correct set of questions*/
quizQuestions[counter];

尝试使用JavaScript进行编码测验

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

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