小编Era*_*ray的帖子

Javascript数学函数

我如何使用这些JavaScript 数学函数

例如,我想计算<input>表单中所有值的平方,而不提交表单.

你能举个例子吗?谢谢.

javascript math jquery

3
推荐指数
1
解决办法
2万
查看次数

使用Yii Framework添加数据

这是我的用户表结构:

+----------------+------------------+------+-----+---------+----------------+
| Field          | Type             | Null | Key | Default | Extra          |
+----------------+------------------+------+-----+---------+----------------+
| ID             | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| screen_name    | varchar(20)      | NO   | UNI | NULL    |                |
| slug           | varchar(20)      | NO   |     | NULL    |                |
| email          | varchar(50)      | NO   | UNI | NULL    |                |
| pass           | varchar(32)      | YES  |     | NULL    |                |
| signin_twitter | enum('T','F') …
Run Code Online (Sandbox Code Playgroud)

php yii yii-cmodel

3
推荐指数
1
解决办法
5169
查看次数

403发送GET数据时出现禁止错误

我的服务器是Linux服务器,而经销商是我的。所以我也可以到达WHM面板。

当GET数据出现时:

a.php?url=http://www.domain.com
Run Code Online (Sandbox Code Playgroud)

返回403禁止。

但是如果数据是这样的:

a.php?url=www.domain.com
Run Code Online (Sandbox Code Playgroud)

它正在工作。

因此,http://生成错误。我该如何解决?

另外,这将返回403 Forbidden:

a.php?url=http%3a%2f%2fwww.domain.com
Run Code Online (Sandbox Code Playgroud)

谢谢。

php apache get http http-status-code-403

2
推荐指数
1
解决办法
2868
查看次数

2行按钮值

我想做一个像这样的按钮.

按钮示例

如您所见,有2行和行的字体大小不同.这可能是使用CSS + HTML(也许是JS)?我不想使用图像作为按钮.

(字体表面无关紧要)

谢谢 ;)

html css button

2
推荐指数
2
解决办法
6858
查看次数

OOP的逻辑错误

我正在学习Yii Framework.我第一次使用框架,我需要一些建议.我的Controller上有一个getSocials()函数.

private function getSocials($id)
    {
        $socials=Socials::model()->find("socials_user=$id");
        foreach ($socials as $social)
        {
            $type = $social["socials_type"];
            $allSocial .= "<li><a href=\"#\" rel=\"nofollow\">$type</a></li>";
        }
        return $allSocial;
    }
Run Code Online (Sandbox Code Playgroud)

(它是私有的,因为我只是从另一个函数调用它).我会逐行解释,

$socials=Socials::model()->find("socials_user=$id");
Run Code Online (Sandbox Code Playgroud)

通过Socials模型从数据库获取socials_user collumn等于$ id的数据.

foreach ($socials as $social)
Run Code Online (Sandbox Code Playgroud)

$ socials作为数组返回,因为有几行,socials_user collumn等于数据库中的$ id.

$allSocial .= "<li><a href=\"#\" rel=\"nofollow\">$type</a></li>";
Run Code Online (Sandbox Code Playgroud)

在foreach循环中,添加<li>...</li>到字符串的结尾,所以$ allSocial将是<li>...</li><li>...</li>...

BUt我得到Undefined变量:allSocial错误.当我从等号(=)前面删除点时,它正在工作.但这次是在foreach循环中,它总是覆盖,最后$ allSocial只包含last<li>...</li>

有任何逻辑错误吗?

php oop yii

2
推荐指数
1
解决办法
216
查看次数

重复使用"表单构造函数"刷新标签文本

我是C#的新手,我有一个小项目.我被困在某个地方.我在这里解释了(带有示例源代码):

我有一个表单应用程序.我要求用户从2个按钮中选择一个选项.有2个按钮(是和否).我的代码是这样的:

public partial class Form1 : Form
{
   public int choice=0;
   public Form1()
   {
      if(choice == 0)
      {
         label.Text = "Please push one of these buttons :";
         // And there are buttons below this label
      }
      else if(choice == 1)
      {
         label.Text = "You just pushed YES button";
      }
      else if(choice == 2)
      {
         label.Text = "You just pushed NO button";
      }
   }

   private void buttonYes_Click(object sender, EventArgs e)
   {
       choice = 1;
       /*
          I have to …
Run Code Online (Sandbox Code Playgroud)

c# refresh winforms

2
推荐指数
1
解决办法
1053
查看次数

将 Symfony 应用程序部署到 Elastic Beanstalk

我正在尝试将 Symfony 应用程序部署到 Elastic Beanstalk,但看起来 URL 重写不起作用。

使用在 64 位 Amazon Linux 2 上运行的 PHP 7.4平台,文档根目录为/public

.platform/nginx/conf.d/nginx.conf

server {
  listen        80;
  root /var/app/current/public;
  index index.php;
  location / {
      # try to serve file directly, fallback to index.php
      try_files $uri /index.php$is_args$args;
  }
   location ~ ^/index\.php(/|$) {
    #fastcgi_pass unix:/var/run/php-fpm.sock;
          fastcgi_pass  php-fpm;
          fastcgi_split_path_info ^(.+\.php)(/.*)$;
        #include fastcgi_params;
          fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
          fastcgi_param DOCUMENT_ROOT $realpath_root;
   }
  access_log    /var/log/nginx/access.log main;
  client_header_timeout 60;
  client_body_timeout   60;
  keepalive_timeout     60;
  gzip                  off;
  gzip_comp_level       4;
  # Include the …
Run Code Online (Sandbox Code Playgroud)

symfony amazon-elastic-beanstalk

2
推荐指数
1
解决办法
452
查看次数

C++函数和'标识符未找到'错误

我是一名C++学习者.我正在尝试编写一个基本的C++项目.这是基本的自动化系统.它有一个导航菜单.

Choose an option :
   1 ) Add a new customer
   2 ) List all customers
   ...
Run Code Online (Sandbox Code Playgroud)

将有一个nav包含用户选择的变量.这是我的源代码:

#include <stdio.h>
#include <clocale>

int nav;    

void main()
{
    setlocale(LC_ALL,"turkish");
    navigasyon();
    switch (nav) // checking 'nav' variable which assigned in navigasyon()
    case "1" :
         printf("Now you are adding a new customer");
    break;
    case "2" :
         printf("Now you are listing all customers");
    break;
}

void navigasyon()
{
    printf("Choose an option \n");
printf("1 ) Add a new customer\n");
printf("2 ) List all …
Run Code Online (Sandbox Code Playgroud)

c++

1
推荐指数
1
解决办法
2万
查看次数

在分叉进程上使用相同的变量

我期待这段代码

void func(int* count)
{
    *count += 1;

    char* buf[100];
    sprintf(buf, "%d -> %d\n", count, *count);
            write(1, buf, strlen(buf));
}
int main()
{
    int* count = 0;
    int pid = fork();
    if(pid == 0)
    {
        func(&count);
    }
    else
    {
        func(&count);
    }

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

将打印

1444711088 -> 1
1444711088 -> 2
Run Code Online (Sandbox Code Playgroud)

因为2 fork使用相同的内存单元格(1444711088)作为count变量,当其中一个修改它的值时,其他一个将受到影响.但它没有按预期工作.打印这个:

1444711088 -> 1
1444711088 -> 1
Run Code Online (Sandbox Code Playgroud)

你能说出这段代码的问题在哪里吗?

c fork

1
推荐指数
1
解决办法
877
查看次数

从 GitHub Pull 请求上的不同分支提交

我正在 GitHub 上使用我们公司应用程序的一个分支。我们有一个开发分支,我们正在从开发创建新分支来处理类似的工作feature/new-feature并在工作完成后创建对原始存储库的拉取请求。当然,在创建 PR 之前要进行变基。

变基后,来自不同开发人员的一些提交(commitAcommitC)合并到我的分支。现在在我的 PR 中,这些提交也列为文件更改。并且与开发有冲突。

很快,我的 PR 的提交列表是这样的:

commitA <---this commmit is different developers and shouldn't be listed here commitB commitC <---this commmit is different developers and shouldn't be listed here ...

如何从我的 PR 中删除这些提交?这些提交(commitA 和 commitC)也在开发分支上。

我的分支应该只有提交 B,commitA 和 commitC 属于开发分支,而不是我的分支。

svn git github pull-request

1
推荐指数
1
解决办法
444
查看次数