使用变量[duplicate]动态访问静态属性

I'm trying to dynamically access a static namespaced property (using delight-im's auth). Possible values could be:

\Delight\Auth\Role::ADMIN
\Delight\Auth\Role::USER

etc

I want to name the ADMIN part dynamically, as such:

\Delight\Auth\Role::$role

But PHP is telling me:

 Access to undeclared static property: Delight\Auth\Role::$role

So I tried to use a variable variable as such:

 \Delight\Auth\Role::$$val

(two $s) and the error changes to:

 Access to undeclared static property: Delight\Auth\Role::$ADMIN

So as you can see the variable is resolved, but there is a $ inserted in there still. I'm using PHP 5.6.37 if that makes a difference.

Is there a way to access static properties dynamically like this?

</div>

展开翻译

译文



此问题已经存在 这里有一个答案:</ p>





  • 使用包含常量名称的简单变量访问类常量



    5 answers

    </ span>

    </ li>

    </ ul>

    </ div>

    我正在尝试动态访问静态命名空间属性(使用delight-im的 auth </ code>)。 可能的值可能是:</ p>

      \ Delight \ Auth \ Role :: ADMIN 
    \ Delight \ Auth \ Role :: USER
    </ code> </ pre> \ n

    etc </ p>

    我想动态命名 ADMIN </ code>部分,如下所示:</ p>

      \ Delight \ Auth \ Role :: $ role 
    </ code> </ pre>

    但PHP告诉我:</ p>

     访问 未声明的静态属性:Delight \ Auth \ Role :: $ role 
    </ code> </ pre>

    所以我尝试使用变量变量:</ p>

    < pre> \ Delight \ Auth \ Role :: $$ val
    </ code> </ pre>

    (两个 $ </ code> s),错误更改为 :</ p>

     访问未声明的静态属性:Delight \ Auth \ Role :: $ ADMIN 
    </ code> </ pre>

    所以当你 可以看到变量已经解析,但仍然有一个 $ </ code>。 如果这有所不同,我正在使用PHP 5.6.37 </ code>。</ p>

    有没有办法像这样动态访问静态属性?</ p>
    </ DIV>

dongmijgnnq0118
dongmijgnnq0118 是ADMIN和USER常量吗?如果是,请阅读此内容。stackoverflow.com/questions/7506530/...
一年多之前 回复

1个回答

You're mixing up your terminology. The syntax you're using is accessing a class's static property, but you're describing features of a class constant.

Static properties are mutatable variables stored on the class. Example from the PHP manual:

<?php
class Foo
{
    public static $my_static = 'foo';

    public function staticValue() {
        return self::$my_static;
    }
}

You'd reference $my_static like this: Foo::$my_static, which is what you're doing.

Class constants seems to be what you're describing. Example from the PHP manual:

<?php
class MyClass
{
    const CONSTANT = 'constant value';

    function showConstant() {
        echo  self::CONSTANT . "
";
    }
}

You'd reference CONSTANT like this: MyClass::CONSTANT.

Here's a better answer describing how to reference class constants dynamically, which is what you're attempting to do.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
oracle dg复制备库约到如下错误
连接主备库 rman target sys/oracle@fc91 auxiliary sys/oracle@fc94 执行脚本: run{ allocate channel c1 type disk; allocate channel c2 type disk; allocate channel c3 type disk; allocate AUXILIARY channel c4 type disk; allocate AUXILIARY channel c5 type disk; allocate AUXILIARY channel c6 type disk; DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE DORECOVER NOFILENAMECHECK; release channel c1; release channel c2; release channel c3; release channel c4; release channel c5; release channel c6; } Recovery Manager: Release 19.0.0.0.0 - Production on Tue Jan 21 16:23:00 2020 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. connected to target database: FC91 (DBID=2505363336) connected to auxiliary database: FC91 (DBID=2505363336, not open) RMAN> 现在日志如下: using target database control file instead of recovery catalog allocated channel: c1 channel c1: SID=729 device type=DISK allocated channel: c2 channel c2: SID=1094 device type=DISK allocated channel: c3 channel c3: SID=609 device type=DISK allocated channel: c4 channel c4: SID=1212 device type=DISK allocated channel: c5 channel c5: SID=1333 device type=DISK allocated channel: c6 channel c6: SID=1454 device type=DISK Starting Duplicate Db at 21-JAN-20 contents of Memory Script: { backup as copy reuse passwordfile auxiliary format '/opt/oracle/product/19c/dbhome_1/dbs/orapwFC94' ; } executing Memory Script Starting backup at 21-JAN-20 Finished backup at 21-JAN-20 contents of Memory Script: { restore clone from service 'fc91' standby controlfile; } executing Memory Script Starting restore at 21-JAN-20 channel c4: starting datafile backup set restore channel c4: using network backup set from service fc91 channel c4: restoring control file channel c4: restore complete, elapsed time: 00:00:01 output file name=/opt/oracle/oradata/FC94/control01.ctl output file name=/opt/oracle/oradata/FC94/control02.ctl Finished restore at 21-JAN-20 contents of Memory Script: { sql clone 'alter database mount standby database'; } executing Memory Script sql statement: alter database mount standby database contents of Memory Script: { set newname for tempfile 1 to "/opt/oracle/oradata/FC94/temp01.dbf"; set newname for tempfile 2 to "/opt/oracle/oradata/FC94/pdbseed/temp012020-01-21_11-02-57-925-AM.dbf"; set newname for tempfile 3 to "/opt/oracle/oradata/FC94/ORCLPDB1/temp01.dbf"; switch clone tempfile all; set newname for datafile 1 to "/opt/oracle/oradata/FC94/system01.dbf"; set newname for datafile 3 to "/opt/oracle/oradata/FC94/sysaux01.dbf"; set newname for datafile 4 to "/opt/oracle/oradata/FC94/undotbs01.dbf"; set newname for datafile 5 to "/opt/oracle/oradata/FC94/pdbseed/system01.dbf"; set newname for datafile 6 to "/opt/oracle/oradata/FC94/pdbseed/sysaux01.dbf"; set newname for datafile 7 to "/opt/oracle/oradata/FC94/users01.dbf"; set newname for datafile 8 to "/opt/oracle/oradata/FC94/pdbseed/undotbs01.dbf"; set newname for datafile 9 to "/opt/oracle/oradata/FC94/ORCLPDB1/system01.dbf"; set newname for datafile 10 to "/opt/oracle/oradata/FC94/ORCLPDB1/sysaux01.dbf"; set newname for datafile 11 to "/opt/oracle/oradata/FC94/ORCLPDB1/undotbs01.dbf"; set newname for datafile 12 to "/opt/oracle/oradata/FC94/ORCLPDB1/users01.dbf"; restore from nonsparse from service 'fc91' clone database ; sql 'alter system archive log current'; } executing Memory Script executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME renamed tempfile 1 to /opt/oracle/oradata/FC94/temp01.dbf in control file renamed tempfile 2 to /opt/oracle/oradata/FC94/pdbseed/temp012020-01-21_11-02-57-925-AM.dbf in control file renamed tempfile 3 to /opt/oracle/oradata/FC94/ORCLPDB1/temp01.dbf in control file executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME Starting restore at 21-JAN-20 channel c4: starting datafile backup set restore channel c4: using network backup set from service fc91 channel c4: specifying datafile(s) to restore from backup set channel c4: restoring datafile 00001 to /opt/oracle/oradata/FC94/system01.dbf released channel: c1 released channel: c2 released channel: c3 released channel: c4 released channel: c5 released channel: c6 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of Duplicate Db command at 01/21/2020 16:12:58 RMAN-05501: aborting duplication of target database RMAN-03015: error occurred in stored script Memory Script ORA-19845: error in backupDataFile while communicating with remote database server ORA-17628: Oracle error 19602 returned by remote Oracle server ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode ORA-19660: some files in the backup set could not be verified ORA-19661: datafile 1 could not be verified ORA-19845: error in backupDataFile while communicating with remote database server ORA-17628: Oracle error 19602 returned by remote Oracle server ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
myeclipse在有jsp中自带的全局声明的时候,静态引入jsp的时候报错
在myeclipse里面新建一个工程后新建b.jsp和a.jsp放在工程的webroot目录下, 在b.jsp的<html>标签上面有jsp中自带的全局路径声明: ``` <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> ``` 在有jsp自带的全局路径声明的情况下,在<body>中静态引入jsp的时候就会报错, ``` <%@include file="a.jsp" %> ``` 错误信息如下: ``` Multiple annotations found at this line: - Duplicate local variable path - Duplicate local variable ``` 中文翻译如下: ``` 这一行有多个注释: -复制本地变量路径 -复制局部变量 ``` 可以确认file的相对路径是对的,因为a.jsp和b.jsp在同一个文件夹下。 另外在删掉jsp中自带的全局声明的时候下面的静态引入就不报错了。
Refrigerator Magnets 冰箱的问题
Problem Description Like many families with small children, my family’s refrigerator is adorned with a set of alphabet magnets: 26 separate magnets, each containing one letter of the alphabet. These magnets can be rearranged to create words and phrases. I feel it is my parental duty to use these magnets to create messages that are witty and insightful, yet at the same time caring and supportive. Unfortunately, I am somewhat hindered in this task by the fact that I can only make phrases that use each letter once. For example, a nice inspiring message to leave for the children might be, “I LOVE YOU.” Unfortunately, I cannot make this message using my magnets because it requires two letter "O"s. I can, however, make the message, “I LOVE MUSTARD.” Admittedly this message isn't as meaningful, but it does manage to not use any letters more than once. You are to write a program that will look at a list of possible phrases and report which phrases can be written using refrigerator magnets. Input The input will consist of one or more lines, ending with a line that contains only the word “END”. Each line will be 60 characters or less, and will consist of one or more words separated by a single space each, with words using only uppercase letters (A–Z). There will not be any leading or trailing whitespace, and there will not be any blank lines. Output Output only the lines which can be written in refrigerator magnets—that is, the lines which have no duplicate letters. Output them exactly the same as they were in the input—white spaces and all. Do not output the final “END” string. Sample Input I LOVE YOU I LOVE MUSTARD HAPPY BIRTHDAY GLAD U BORN SMILE IMAGINE WHATS UP DOC HAVE A NICE DAY END Sample Output I LOVE MUSTARD GLAD U BORN SMILE WHATS UP DOC
mysql 插入字符有问题
mysql 插入字符问题,因为有一个字段我作了key,不能有重复数据, 在字段添加 a 字符后无法再添加 á 字符,提示 ``` 1062 - Duplicate entry 'á' for key 'chars' ``` **á ** 带声调的属于HTML实体字符,难道mysql认为 a 和 á 是一样的编码? 而且取 a 数据的时候 ,也会把 á 的数据取出来。 使用的服务器版本: 5.7.20 - MySQL Community Server 字符编码采用 UTF-8
android duplicate entry报错
一个项目有两个模块引入了同一个库,引入方式如下: ``` 1、compile 'com.jph.takephoto:takephoto_library:4.0.3' 2、compile(name: 'takephoto_library', ext: 'aar') ``` 项目真机可以正常运行,可是打包APK的时候报错: Cause: duplicate entry: com/jph/takephoto/compress/CompressImageUtil$2.class 下面两张图是引入库: 1、![图片说明](https://img-ask.csdn.net/upload/201909/18/1568787034_365295.jpg) ![图片说明](https://img-ask.csdn.net/upload/201909/18/1568787049_760139.jpg)
Refrigerator Magnets 的问题
Problem Description Like many families with small children, my family’s refrigerator is adorned with a set of alphabet magnets: 26 separate magnets, each containing one letter of the alphabet. These magnets can be rearranged to create words and phrases. I feel it is my parental duty to use these magnets to create messages that are witty and insightful, yet at the same time caring and supportive. Unfortunately, I am somewhat hindered in this task by the fact that I can only make phrases that use each letter once. For example, a nice inspiring message to leave for the children might be, “I LOVE YOU.” Unfortunately, I cannot make this message using my magnets because it requires two letter "O"s. I can, however, make the message, “I LOVE MUSTARD.” Admittedly this message isn't as meaningful, but it does manage to not use any letters more than once. You are to write a program that will look at a list of possible phrases and report which phrases can be written using refrigerator magnets. Input The input will consist of one or more lines, ending with a line that contains only the word “END”. Each line will be 60 characters or less, and will consist of one or more words separated by a single space each, with words using only uppercase letters (A–Z). There will not be any leading or trailing whitespace, and there will not be any blank lines. Output Output only the lines which can be written in refrigerator magnets—that is, the lines which have no duplicate letters. Output them exactly the same as they were in the input—white spaces and all. Do not output the final “END” string. Sample Input I LOVE YOU I LOVE MUSTARD HAPPY BIRTHDAY GLAD U BORN SMILE IMAGINE WHATS UP DOC HAVE A NICE DAY END Sample Output I LOVE MUSTARD GLAD U BORN SMILE WHATS UP DOC
关于Duplicate column name 'XXX'的不解
执行查询语句: SELECT * FROM toe_tele_list LEFT JOIN toe_count ON toe_tele_list.`code` = toe_count.`CODE` 得到以下表格: ![图片说明](https://img-ask.csdn.net/upload/201907/31/1564553757_112903.jpg) 很明显,这是一个左连接得到的查询结果,现在我要存储结果为一个新的表格 出现问题: 我写的代码如下: CREATE TABLE toe_count_v2 AS SELECT * FROM ( toe_tele_list LEFT JOIN toe_count ON toe_tele_list.`code` = toe_count.`CODE`); 错误代码: 1060 Duplicate column name 'CODE' 我能理解提示的意思说我的两个进行左连接的表格都有‘code’列,重名了吧,但是我不知道如何更改,我试过将select*变为select toe_tele_list.*,能够执行,但是结果保存的表格没有toe_count这张表的内容,只有第一张表的内容,非常困惑,望解惑!
Duplicate class found in the file
``` 使用idea 创建了datastructure文件夹,并将其设置为source root. 在该文件下分别创建了两个不同的包,在不同的包下创建了Node类![图片说明](https://img-ask.csdn.net/upload/201908/06/1565033068_396799.png) ```
One is an Interesting Number 有趣的数字
Problem Description Numbers are interesting, but some are inherently more interesting than others, by various criteria. Given a collection of numbers, you are to find the most interesting ones. A number X is more interesting than another number Y if it has more attributes than Y. For the purposes of this problem, the attributes that are interesting are: Note that 0 has no multiples other than itself, and 1 is not prime. In addition to the above attributes, there are also those which depend on the other numbers in a given collection: This makes for a total of thirteen possible attributes. Note that meeting the criteria for a particular attribute in multiple ways (1 is the factor of all other numbers, for example) still only counts as a single instance of an attribute. Given a collection of numbers, you are to determine which numbers in that collection are most interesting. Input Input to this problem will begin with a line containing a single integer N (1 ≤ N ≤ 100) indicating the number of data sets. Each data set consists of the following components: A line containing a single integer M (1 ≤ M ≤ 100) indicating how many numbers are in the collection; A series of M lines, each with a single integer X (1 ≤ X ≤ 1000000). There will be no duplicate integers X within the same data set. Output For each data set in the input, output the heading "DATA SET #k" where k is 1 for the first data set, 2 for the second, and so on. For each data set, print the number or numbers that are most interesting in the collection. If more than one number ties for "most interesting," print them in ascending order, one to a line. Sample Input 2 2 1 100 3 2 3 4 Sample Output DATA SET #1 1 DATA SET #2 4
Schottkey 7th Path 程序是怎么编写的呢
Problem Description With a typical operating system, a filesystem consists of a number of directories, in which reside files. These files generally have a canonical location, known as the absolute path (such as /usr/games/bin/kobodl), which can be used to refer to the file no matter where the user is on a system. Most operating system environments allow you to refer to files in other directories without having to be so explicit about their locations, however. This is often stored in a variable called PATH, and is an ordered list of locations (always absolute paths in this problem) to search for a given name. We will call these search paths. In the brand-new crash shell, paths are handled somewhat differently. Users still provide an ordered list of locations that they wish to search for files (their search paths); when a particular filename is requested, however, crash tries to be even more helpful than usual. The process it follows is as follows: If there is an exact match for the filename, it is returned. Exact matches in locations earlier in the list are preferred. (There are no duplicate filenames in a single location.) If there are no exact matches, a filename that has a single extra character is returned. That character may be at any point in the filename, but the order of the non-extra characters must be identical to the requested filename. As before, matches in locations earlier in the list are preferred; if there are multiple matches in the highest-ranked location, all such matches in that location are returned. If there are no exact matches or one-extra-character matches, files that have two extra characters are looked for. The same rules of precedence and multiple matches apply as for the one-extra-character case. If no files meet the three criteria above, no filenames are returned. Two characters is considered the limit of "permissiveness" for the crash shell. So, for example, given the two files bang and tang, they are both one character away from the filename ang and two from ag. (All characters in this problem will be lowercase.) In the sample data below, both cat and rat are one character away from at. Given a complete list of locations and files in those locations on a system, a set of users each with their own ordered lists of search paths, and a set of files that they wish to search for, what filenames would crash return? For the purposes of simplification, all locations will be described by a single alphabetic string, as will filenames and usernames. Real operating system paths often have many components separated by characters such as slashes, but this problem does not. Also note that users may accidentally refer to nonexistent locations in their search paths; these (obviously) contain no files. Input All alphabetic strings in the input will have at least one and at most 20 characters, and will contain no special characters such as slashes or spaces; all letters will be lowercase. Input to this problem will begin with a line containing a single integer N (1 ≤ N ≤ 100) indicating the number of data sets. Each data set consists of the following components: A line containing a single integer F (1 ≤ F ≤ 100) indicating the number of files on the system; A series of F lines representing the files on the system, in the format "location filename", where location and filename are both alphabetic strings; A line containing a single integer U (1 ≤ U ≤ 10) indicating the number of users on the system; A series of U stanzas representing the users. Each stanza consists of the following components: A line containing a single alphabetic string which is the user'susername; A line containing a single integer L (1 ≤ L ≤ 10) representing the number of locations in the user's search path; and A series of L lines containing a single alphabetic string apiece listing the locations in the user's search path. The first one is the highest priority, the second (if present) is the second-highest priority, and so on. A line containing a single integer S (1 ≤ S ≤ 200) indicating the number of file searches to run; A series of S lines representing the searches, in the format "username filename", where username is an alphabetic string that matches one of the users defined in the data set, and filename is an alphabetic string that represents the requested filename. Output For each data set in the input, output the heading "DATA SET #k" where k is 1 for the first data set, 2 for the second, etc. Then for each of the S searches in the data set (and in the same order as read from the input) do the following: Print the line "username REQUESTED filename" where filename is the file requested by username. For each file (if any) that matches this search, print the line "FOUND filename IN location" where filename is the file that matched the user's request and that was found in location. The list of matching files must be sorted in alphabetical order by filename. Sample Input 1 4 food oat food goat animal rat animal cat 2 bob 2 food animal bill 1 animal 4 bob at bob cat bill goat bill at Sample Output DATA SET #1 bob REQUESTED at FOUND oat IN food bob REQUESTED cat FOUND cat IN animal bill REQUESTED goat bill REQUESTED at FOUND cat IN animal FOUND rat IN animal
One is an Interesting Number 代码怎么编写
Problem Description Numbers are interesting, but some are inherently more interesting than others, by various criteria. Given a collection of numbers, you are to find the most interesting ones. A number X is more interesting than another number Y if it has more attributes than Y. For the purposes of this problem, the attributes that are interesting are: Note that 0 has no multiples other than itself, and 1 is not prime. In addition to the above attributes, there are also those which depend on the other numbers in a given collection: This makes for a total of thirteen possible attributes. Note that meeting the criteria for a particular attribute in multiple ways (1 is the factor of all other numbers, for example) still only counts as a single instance of an attribute. Given a collection of numbers, you are to determine which numbers in that collection are most interesting. Input Input to this problem will begin with a line containing a single integer N (1 ≤ N ≤ 100) indicating the number of data sets. Each data set consists of the following components: A line containing a single integer M (1 ≤ M ≤ 100) indicating how many numbers are in the collection; A series of M lines, each with a single integer X (1 ≤ X ≤ 1000000). There will be no duplicate integers X within the same data set. Output For each data set in the input, output the heading "DATA SET #k" where k is 1 for the first data set, 2 for the second, and so on. For each data set, print the number or numbers that are most interesting in the collection. If more than one number ties for "most interesting," print them in ascending order, one to a line. Sample Input 2 2 1 100 3 2 3 4 Sample Output DATA SET #1 1 DATA SET #2 4
报错Duplicate keys detected: '1'. This may cause an update error.怎么解决
并没有使用for循环 只是v-model 然后无限报错。。。求大佬指教![图片说明](https://img-ask.csdn.net/upload/201911/01/1572590359_723696.png)
One is an Interesting Number
Problem Description Numbers are interesting, but some are inherently more interesting than others, by various criteria. Given a collection of numbers, you are to find the most interesting ones. A number X is more interesting than another number Y if it has more attributes than Y. For the purposes of this problem, the attributes that are interesting are: Note that 0 has no multiples other than itself, and 1 is not prime. In addition to the above attributes, there are also those which depend on the other numbers in a given collection: This makes for a total of thirteen possible attributes. Note that meeting the criteria for a particular attribute in multiple ways (1 is the factor of all other numbers, for example) still only counts as a single instance of an attribute. Given a collection of numbers, you are to determine which numbers in that collection are most interesting. Input Input to this problem will begin with a line containing a single integer N (1 ≤ N ≤ 100) indicating the number of data sets. Each data set consists of the following components: A line containing a single integer M (1 ≤ M ≤ 100) indicating how many numbers are in the collection; A series of M lines, each with a single integer X (1 ≤ X ≤ 1000000). There will be no duplicate integers X within the same data set. Output For each data set in the input, output the heading "DATA SET #k" where k is 1 for the first data set, 2 for the second, and so on. For each data set, print the number or numbers that are most interesting in the collection. If more than one number ties for "most interesting," print them in ascending order, one to a line. Sample Input 2 2 1 100 3 2 3 4 Sample Output DATA SET #1 1 DATA SET #2 4
Duplicate local variable page
用jsp做分页时, int page = 1;表示当前页, <a href="articleFlat.jsp?page=<%=page-1 %>">上一页</a> 链接中的page作为页数参数。出现Duplicate local variable page的错误。 于是我把链接中的page改为pageNo还是出现同样的错误。最后 把int page=1;中的page该为pgeNo程序正常。参数和变量同为page出 错,为什么同时换成pgeNo就行?
用荣耀9调试显示[ThreadDexHotfixMonitor]Bind hotfix monitor service fail!
有没有大佬看看这是什么问题啊,用荣耀9调试的时候日志显示[ThreadDexHotfixMonitor]Bind hotfix monitor service fail! 手机上打开了开发者模式,android studio也能连上,就想发条通知,但怎么点击按钮都没用。下面是debug日志 10-02 17:16:04.256 16362-16362/? I/otificationtes: Late-enabling -Xcheck:jni 10-02 17:16:04.330 16362-16362/? I/otificationtes: Reinit property: dalvik.vm.checkjni= false 10-02 17:16:04.346 16362-16362/? D/ZrHung.AppEyeUiProbe: AppEyeUIP created. 10-02 17:16:04.349 16362-16362/? D/ActivityThread: Attach thread to application 10-02 17:16:04.432 16362-16393/com.example.notificationtest I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.example.notificationtest#10223#256 10-02 17:16:04.434 16362-16393/com.example.notificationtest I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.example.notificationtest#10223#0 10-02 17:16:04.457 16362-16362/com.example.notificationtest I/InstantRun: Instant Run Runtime started. Android package is com.example.notificationtest, real application class is null. 10-02 17:16:04.642 16362-16362/com.example.notificationtest W/otificationtes: Accessing hidden method Ldalvik/system/BaseDexClassLoader;->getLdLibraryPath()Ljava/lang/String; (light greylist, reflection) 10-02 17:16:04.644 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:04.770 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:04.770 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:04.842 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:04.843 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:04.933 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:04.933 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:05.006 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:05.007 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:05.092 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:05.093 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:05.163 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:05.164 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:05.243 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:05.244 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:05.342 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:05.343 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:05.442 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:05.442 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:05.526 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:05.527 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:05.659 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:05.660 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:05.746 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:05.746 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:05.817 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:05.818 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:05.946 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:05.947 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:06.055 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:06.056 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:06.182 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:06.183 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:06.305 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:06.306 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:06.493 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:06.494 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:06.710 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:06.711 16362-16362/com.example.notificationtest W/otificationtes: Unsupported class loader 10-02 17:16:06.785 16362-16362/com.example.notificationtest W/otificationtes: Skipping duplicate class check due to unsupported classloader 10-02 17:16:06.787 16362-16362/com.example.notificationtest W/otificationtes: Accessing hidden field Ljava/lang/ClassLoader;->parent:Ljava/lang/ClassLoader; (light greylist, reflection) 10-02 17:16:06.790 16362-16362/com.example.notificationtest W/otificationtes: Accessing hidden method Landroid/app/ActivityThread;->currentActivityThread()Landroid/app/ActivityThread; (light greylist, reflection) 10-02 17:16:06.790 16362-16362/com.example.notificationtest W/otificationtes: Accessing hidden field Landroid/app/ActivityThread;->mInitialApplication:Landroid/app/Application; (light greylist, reflection) 10-02 17:16:06.790 16362-16362/com.example.notificationtest W/otificationtes: Accessing hidden field Landroid/app/ActivityThread;->mAllApplications:Ljava/util/ArrayList; (light greylist, reflection) 10-02 17:16:06.790 16362-16362/com.example.notificationtest W/otificationtes: Accessing hidden field Landroid/app/LoadedApk;->mApplication:Landroid/app/Application; (light greylist, reflection) 10-02 17:16:06.790 16362-16362/com.example.notificationtest W/otificationtes: Accessing hidden field Landroid/app/LoadedApk;->mResDir:Ljava/lang/String; (light greylist, reflection) 10-02 17:16:06.790 16362-16362/com.example.notificationtest W/otificationtes: Accessing hidden field Landroid/app/Application;->mLoadedApk:Landroid/app/LoadedApk; (light greylist, reflection) 10-02 17:16:06.790 16362-16362/com.example.notificationtest W/otificationtes: Accessing hidden field Landroid/app/ActivityThread;->mPackages:Landroid/util/ArrayMap; (light greylist, reflection) 10-02 17:16:06.790 16362-16362/com.example.notificationtest W/otificationtes: Accessing hidden field Landroid/app/ActivityThread;->mResourcePackages:Landroid/util/ArrayMap; (light greylist, reflection) 10-02 17:16:06.795 16362-16393/com.example.notificationtest I/AwareBitmapCacher: init processName:com.example.notificationtest pid=16362 uid=10223 10-02 17:16:06.798 16362-16791/com.example.notificationtest E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@28ac4fd 10-02 17:16:06.798 16362-16791/com.example.notificationtest E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@d43b3f9 10-02 17:16:06.800 16362-16362/com.example.notificationtest D/ZrHung.AppEyeUiProbe: notify runnable to start. 10-02 17:16:06.802 16362-16793/com.example.notificationtest D/ZrHung.AppEyeUiProbe: Runnable thread started. 10-02 17:16:06.802 16362-16393/com.example.notificationtest E/MemoryLeakMonitorManager: MemoryLeakMonitor.jar is not exist! 10-02 17:16:06.802 16362-16793/com.example.notificationtest D/IMonitor: Load library imonitor_jni 10-02 17:16:06.904 16362-16362/com.example.notificationtest I/HwApsImpl: APS: new HwApsImpl created 10-02 17:16:06.911 16362-16362/com.example.notificationtest I/HwPhoneWindow: updateLayoutParamsColor false mSpecialSet=false, mForcedNavigationBarColor=false, navigationBarColor=0, mNavBarShow=false, mIsFloating=false 10-02 17:16:06.911 16362-16362/com.example.notificationtest I/HwPhoneWindow: updateLayoutParamsColor true mSpecialSet=true, mForcedNavigationBarColor=false, navigationBarColor=fffcfcfc, mNavBarShow=false, mIsFloating=false 10-02 17:16:06.934 16362-16362/com.example.notificationtest I/OverScrollerOptimization: start init SmartSlideOverScroller and get the overscroller config 10-02 17:16:06.934 16362-16362/com.example.notificationtest I/OverScrollerOptimization: get the overscroller config 10-02 17:16:06.938 16362-16362/com.example.notificationtest I/FLTAG_FM: loadFeature class:com.huawei.featurelayer.systemfeature.HwWidget.IHwSplineOverScrollerEx 10-02 17:16:06.938 16362-16362/com.example.notificationtest I/FLTAG_SFM: getRequireClassLoader() succ ! className: com.huawei.featurelayer.systemfeature.HwWidget.IHwSplineOverScrollerEx 10-02 17:16:06.938 16362-16362/com.example.notificationtest D/FeatureFactory: loadFeature() : com.huawei.featurelayer.systemfeature.HwWidget.IHwSplineOverScrollerEx 10-02 17:16:06.938 16362-16362/com.example.notificationtest D/FeatureFactory: loadFeature() new IHwSplineOverScrollerEx() 10-02 17:16:06.939 16362-16362/com.example.notificationtest D/HwSplineOverScrollerExImpl: initSplineOverScrollerImpl paras: android.widget.OverScroller$SplineOverScroller@5f9433,android.support.v7.view.ContextThemeWrapper@a4bd3f0 10-02 17:16:06.940 16362-16362/com.example.notificationtest D/HwSplineOverScrollerExImpl: initSplineOverScrollerImpl: mScrollerVelocity is 0, value is 0 10-02 17:16:06.941 16362-16362/com.example.notificationtest I/FLTAG_FM: loadFeature class:com.huawei.featurelayer.systemfeature.HwWidget.IHwSplineOverScrollerEx 10-02 17:16:06.941 16362-16362/com.example.notificationtest I/FLTAG_SFM: getRequireClassLoader() succ ! className: com.huawei.featurelayer.systemfeature.HwWidget.IHwSplineOverScrollerEx 10-02 17:16:06.941 16362-16362/com.example.notificationtest D/FeatureFactory: loadFeature() : com.huawei.featurelayer.systemfeature.HwWidget.IHwSplineOverScrollerEx 10-02 17:16:06.941 16362-16362/com.example.notificationtest D/FeatureFactory: loadFeature() new IHwSplineOverScrollerEx() 10-02 17:16:06.941 16362-16362/com.example.notificationtest D/HwSplineOverScrollerExImpl: initSplineOverScrollerImpl paras: android.widget.OverScroller$SplineOverScroller@b323f1c,android.support.v7.view.ContextThemeWrapper@a4bd3f0 10-02 17:16:06.941 16362-16362/com.example.notificationtest D/HwSplineOverScrollerExImpl: initSplineOverScrollerImpl: mScrollerVelocity is 0, value is 0 10-02 17:16:06.979 16362-16362/com.example.notificationtest W/otificationtes: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection) 10-02 17:16:06.980 16362-16362/com.example.notificationtest W/otificationtes: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection) 10-02 17:16:06.990 16362-16362/com.example.notificationtest D/TextView: get Display Panel Type is : 0 10-02 17:16:07.005 16362-16362/com.example.notificationtest D/ActivityThread: add activity client record, r= ActivityRecord{29dbe14 token=android.os.BinderProxy@b543ac0 {com.example.notificationtest/com.example.notificationtest.MainActivity}} token= android.os.BinderProxy@b543ac0 10-02 17:16:07.010 16362-16362/com.example.notificationtest D/ZrHung.AppEyeUiProbe: notify runnable to start. 10-02 17:16:07.021 16362-16362/com.example.notificationtest D/OpenGLRenderer: Skia GL Pipeline 10-02 17:16:07.027 16362-16362/com.example.notificationtest D/HwAppInnerBoostImpl: set config for com.example.notificationtest BOOST_FLAG=false REPORT_DURATION_CLICK=1000 REPORT_TIMES_CLICK=3 REPORT_DURATION_SLIDE=5000 REPORT_TIMES_SLIDE=16 10-02 17:16:07.028 16362-16362/com.example.notificationtest D/OpenGLRenderer: HWUI Binary is enabled 10-02 17:16:07.028 16362-16362/com.example.notificationtest D/OpenGLRenderer: disableOutlineDraw is true 10-02 17:16:07.053 16362-16799/com.example.notificationtest I/HiTouch_HiTouchSensor: enabledInPad = false,isPcCastMode = false 10-02 17:16:07.055 16362-16799/com.example.notificationtest D/HiTouch_PressGestureDetector: onAttached, package=com.example.notificationtest, windowType=1, mHiTouchRestricted=false 10-02 17:16:07.099 16362-16797/com.example.notificationtest I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0 10-02 17:16:07.099 16362-16797/com.example.notificationtest I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0 10-02 17:16:07.101 16362-16797/com.example.notificationtest I/iGraphics: [0020080c] pn: com.example.notificationtest, p: 16362 10-02 17:16:07.101 16362-16797/com.example.notificationtest I/iGraphics: [0030080c] no spt app: com.example.notificationtest 10-02 17:16:07.101 16362-16797/com.example.notificationtest I/OpenGLRenderer: Initialized EGL, version 1.4, mEglDisplay 0x1 10-02 17:16:07.101 16362-16797/com.example.notificationtest D/OpenGLRenderer: Swap behavior 2 10-02 17:16:07.114 16362-16797/com.example.notificationtest D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000 10-02 17:16:07.374 16362-16362/com.example.notificationtest W/InputMethodManager: startInputReason = 1 10-02 17:16:07.389 16362-16362/com.example.notificationtest W/InputMethodManager: startInputReason = 5 10-02 17:16:09.655 16362-16418/com.example.notificationtest W/ServiceManager: Service huawei.android.security.IAppBehaviorDataAnalyzer didn't start. Returning NULL 10-02 17:16:09.655 16362-16418/com.example.notificationtest E/[HOTFIX]: [ThreadDexHotfixMonitor]Bind hotfix monitor service fail! 10-02 17:16:11.803 16362-16362/com.example.notificationtest D/AwareBitmapCacher: handleInit switch not opened pid=16362 10-02 17:16:13.556 16362-16362/com.example.notificationtest W/Settings: Setting device_provisioned has moved from android.provider.Settings.Secure to android.provider.Settings.Global. 10-02 17:16:13.614 16362-16362/com.example.notificationtest I/ViewRootImpl: jank_removeInvalidNode jank list is null 10-02 17:16:13.744 16362-16362/com.example.notificationtest D/HwGalleryCacheManagerImpl: mIsEffect:false 10-02 17:16:20.627 16362-16362/com.example.notificationtest I/ViewRootImpl: jank_removeInvalidNode all the node in jank list is out of time
Schottkey 7th Path 我不会了
Problem Description With a typical operating system, a filesystem consists of a number of directories, in which reside files. These files generally have a canonical location, known as the absolute path (such as /usr/games/bin/kobodl), which can be used to refer to the file no matter where the user is on a system. Most operating system environments allow you to refer to files in other directories without having to be so explicit about their locations, however. This is often stored in a variable called PATH, and is an ordered list of locations (always absolute paths in this problem) to search for a given name. We will call these search paths. In the brand-new crash shell, paths are handled somewhat differently. Users still provide an ordered list of locations that they wish to search for files (their search paths); when a particular filename is requested, however, crash tries to be even more helpful than usual. The process it follows is as follows: If there is an exact match for the filename, it is returned. Exact matches in locations earlier in the list are preferred. (There are no duplicate filenames in a single location.) If there are no exact matches, a filename that has a single extra character is returned. That character may be at any point in the filename, but the order of the non-extra characters must be identical to the requested filename. As before, matches in locations earlier in the list are preferred; if there are multiple matches in the highest-ranked location, all such matches in that location are returned. If there are no exact matches or one-extra-character matches, files that have two extra characters are looked for. The same rules of precedence and multiple matches apply as for the one-extra-character case. If no files meet the three criteria above, no filenames are returned. Two characters is considered the limit of "permissiveness" for the crash shell. So, for example, given the two files bang and tang, they are both one character away from the filename ang and two from ag. (All characters in this problem will be lowercase.) In the sample data below, both cat and rat are one character away from at. Given a complete list of locations and files in those locations on a system, a set of users each with their own ordered lists of search paths, and a set of files that they wish to search for, what filenames would crash return? For the purposes of simplification, all locations will be described by a single alphabetic string, as will filenames and usernames. Real operating system paths often have many components separated by characters such as slashes, but this problem does not. Also note that users may accidentally refer to nonexistent locations in their search paths; these (obviously) contain no files. Input All alphabetic strings in the input will have at least one and at most 20 characters, and will contain no special characters such as slashes or spaces; all letters will be lowercase. Input to this problem will begin with a line containing a single integer N (1 ≤ N ≤ 100) indicating the number of data sets. Each data set consists of the following components: A line containing a single integer F (1 ≤ F ≤ 100) indicating the number of files on the system; A series of F lines representing the files on the system, in the format "location filename", where location and filename are both alphabetic strings; A line containing a single integer U (1 ≤ U ≤ 10) indicating the number of users on the system; A series of U stanzas representing the users. Each stanza consists of the following components: A line containing a single alphabetic string which is the user'susername; A line containing a single integer L (1 ≤ L ≤ 10) representing the number of locations in the user's search path; and A series of L lines containing a single alphabetic string apiece listing the locations in the user's search path. The first one is the highest priority, the second (if present) is the second-highest priority, and so on. A line containing a single integer S (1 ≤ S ≤ 200) indicating the number of file searches to run; A series of S lines representing the searches, in the format "username filename", where username is an alphabetic string that matches one of the users defined in the data set, and filename is an alphabetic string that represents the requested filename. Output For each data set in the input, output the heading "DATA SET #k" where k is 1 for the first data set, 2 for the second, etc. Then for each of the S searches in the data set (and in the same order as read from the input) do the following: Print the line "username REQUESTED filename" where filename is the file requested by username. For each file (if any) that matches this search, print the line "FOUND filename IN location" where filename is the file that matched the user's request and that was found in location. The list of matching files must be sorted in alphabetical order by filename. Sample Input 1 4 food oat food goat animal rat animal cat 2 bob 2 food animal bill 1 animal 4 bob at bob cat bill goat bill at Sample Output DATA SET #1 bob REQUESTED at FOUND oat IN food bob REQUESTED cat FOUND cat IN animal bill REQUESTED goat bill REQUESTED at FOUND cat IN animal FOUND rat IN animal
xcode报错:duplicate symbol
写了一段代码 之前测试的时候可以运行 后来不知道加了什么引起报错,报错如下: duplicate symbol _OBJC_IVAR_$_WordChooser._theword in: /Users/themacairof202/Library/Developer/Xcode/DerivedData/test_file_1-bjtlsetupimkydblqinsnpxunfav/Build/Intermediates/test file 1.build/Debug-iphonesimulator/test file 1.build/Objects-normal/i386/gamemodel.o /Users/themacairof202/Library/Developer/Xcode/DerivedData/test_file_1-bjtlsetupimkydblqinsnpxunfav/Build/Intermediates/test file 1.build/Debug-iphonesimulator/test file 1.build/Objects-normal/i386/WordChooser.o duplicate symbol _OBJC_METACLASS_$_WordChooser in: /Users/themacairof202/Library/Developer/Xcode/DerivedData/test_file_1-bjtlsetupimkydblqinsnpxunfav/Build/Intermediates/test file 1.build/Debug-iphonesimulator/test file 1.build/Objects-normal/i386/gamemodel.o /Users/themacairof202/Library/Developer/Xcode/DerivedData/test_file_1-bjtlsetupimkydblqinsnpxunfav/Build/Intermediates/test file 1.build/Debug-iphonesimulator/test file 1.build/Objects-normal/i386/WordChooser.o duplicate symbol _OBJC_CLASS_$_WordChooser in: /Users/themacairof202/Library/Developer/Xcode/DerivedData/test_file_1-bjtlsetupimkydblqinsnpxunfav/Build/Intermediates/test file 1.build/Debug-iphonesimulator/test file 1.build/Objects-normal/i386/gamemodel.o /Users/themacairof202/Library/Developer/Xcode/DerivedData/test_file_1-bjtlsetupimkydblqinsnpxunfav/Build/Intermediates/test file 1.build/Debug-iphonesimulator/test file 1.build/Objects-normal/i386/WordChooser.o ld: 3 duplicate symbols for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) 大约意思是说程序里有重复的文件?求解怎么排查
The SetStack Computer
Problem Description Background from Wikipedia: 揝et theory is a branch of mathematics created principally by the German mathematician Georg Cantor at the end of the 19th century. Initially controversial, set theory has come to play the role of a foundational theory in modern mathematics, in the sense of a theory invoked to justify assumptions made inmathematics concerning the existence of mathematical objects (such as numbers or functions) and their properties. Formal versions of set theory also have a foundational role to play as specifying a theoretical ideal of mathematical rigor in proofs.?Given this importance of sets, being the basis of mathematics, a set of eccentric theorist set off to construct a supercomputer operating on sets instead of numbers. The initial Set-Stack Alpha is under construction, and they need you to simulate it in order to verify the operation of the prototype. The computer operates on a single stack of sets, which is initially empty. After each operation, the cardinality of the topmost set on the stack is output. The cardinality of a set S is denoted |S| and is the number of elements in S. The instruction set of the SetStack Alpha is PUSH, DUP, UNION, INTERSECT, and ADD. ?PUSH will push the empty set {} on the stack. ?DUP will duplicate the topmost set (pop the stack, and then push that set on the stack twice). ?UNION will pop the stack twice and then push the union of the two sets on the stack. ?INTERSECT will pop the stack twice and then push the intersection of the two sets on the stack. ?ADD will pop the stack twice, add the first set to the second one, and then push the resulting set on the stack. For illustration purposes, assume that the topmost element of the stack is A = {{}, {{}}} and that the next one is B = {{}, {{{}}}}. For these sets, we have |A| = 2 and |B| = 2. Then: ?UNION would result in the set { {}, {{}}, {{{}}} }. The output is 3. ?INTERSECT would result in the set { {} }. The output is 1. ?ADD would result in the set { {}, {{{}}}, {{},{{}}} }. The output is 3. Input An integer 0 <= T <= 5 on the first line gives the cardinality of the set of test cases. The first line of each test case contains the number of operations 0 <= N <= 2 000. Then follow N lines each containing one of the five commands. It is guaranteed that the SetStack computer can execute all the commands in the sequence without ever popping an empty stack. Output For each operation specified in the input, there will be one line of output consisting of a single integer. This integer is the cardinality of the topmost element of the stack after the corresponding command has executed. After each test case there will be a line with *** (three asterisks). Sample Input 2 9 PUSH DUP ADD PUSH ADD DUP ADD DUP UNION 5 PUSH PUSH ADD PUSH INTERSECT Sample Output 0 0 1 0 1 1 2 2 2 *** 0 0 1 0 0 ***
mybatis 执行 INSERT … ON DUPLICATE KEY UPDATE
mybatis 在执行 INSERT … ON DUPLICATE KEY UPDATE 格式的语句的时候 没有报错,库表也没插入数据,数据库是mysql 用mysql客户端执行这条语句的时候却是能插入的 是因为myBatis不支持吗? 语句示例: INSERT INTO test (main_id,score,totalCount) VALUES (123,5.0,12345) ON DUPLICATE KEY UPDATE score=VALUES(score), totalCount=VALUES(totalCount) main_id是主键,以上语在mysql客户端执行能正确插入或更新 <insert id="insertOrUpdate" parameterType="这里就不写了"> INSERT INTO test (main_id,score,totalCount) VALUES (456,5.0,12345) <!--这里有个参数是456,同上面一条的123不一样--> ON DUPLICATE KEY UPDATE score=VALUES(score), totalCount=VALUES(totalCount) </insert> 这是mybatis里面执行的语句,为了直观些,我直接写了一条死语句进来。 同样的两条语句,在mybatis里面执行的时候也不报错,但是数据库却插不进去,也不能更新 求解!
Kafka实战(三) - Kafka的自我修养与定位
Apache Kafka是消息引擎系统,也是一个分布式流处理平台(Distributed Streaming Platform) Kafka是LinkedIn公司内部孵化的项目。LinkedIn最开始有强烈的数据强实时处理方面的需求,其内部的诸多子系统要执行多种类型的数据处理与分析,主要包括业务系统和应用程序性能监控,以及用户行为数据处理等。 遇到的主要问题: 数据正确性不足 数据的收集主要...
volatile 与 synchronize 详解
Java支持多个线程同时访问一个对象或者对象的成员变量,由于每个线程可以拥有这个变量的拷贝(虽然对象以及成员变量分配的内存是在共享内存中的,但是每个执行的线程还是可以拥有一份拷贝,这样做的目的是加速程序的执行,这是现代多核处理器的一个显著特性),所以程序在执行过程中,一个线程看到的变量并不一定是最新的。 volatile 关键字volatile可以用来修饰字段(成员变量),就是告知程序任何对该变量...
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
有哪些让程序员受益终生的建议
从业五年多,辗转两个大厂,出过书,创过业,从技术小白成长为基层管理,联合几个业内大牛回答下这个问题,希望能帮到大家,记得帮我点赞哦。 敲黑板!!!读了这篇文章,你将知道如何才能进大厂,如何实现财务自由,如何在工作中游刃有余,这篇文章很长,但绝对是精品,记得帮我点赞哦!!!! 一腔肺腑之言,能看进去多少,就看你自己了!!! 目录: 在校生篇: 为什么要尽量进大厂? 如何选择语言及方...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 free -m 其中:m表示兆,也可以用g,注意都要小写 Men:表示物理内存统计 total:表示物理内存总数(total=used+free) use...
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
GitHub开源史上最大规模中文知识图谱
近日,一直致力于知识图谱研究的 OwnThink 平台在 Github 上开源了史上最大规模 1.4 亿中文知识图谱,其中数据是以(实体、属性、值),(实体、关系、实体)混合的形式组织,数据格式采用 csv 格式。 到目前为止,OwnThink 项目开放了对话机器人、知识图谱、语义理解、自然语言处理工具。知识图谱融合了两千五百多万的实体,拥有亿级别的实体属性关系,机器人采用了基于知识图谱的语义感...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发...
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 演示地点演示 html代码如下` music 这个年纪 七月的风 音乐 ` 然后就是css`*{ margin: 0; padding: 0; text-decoration: none; list-...
微信支付崩溃了,但是更让马化腾和张小龙崩溃的竟然是……
loonggg读完需要3分钟速读仅需1分钟事件还得还原到昨天晚上,10 月 29 日晚上 20:09-21:14 之间,微信支付发生故障,全国微信支付交易无法正常进行。然...
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。
数据库优化 - SQL优化
以实际SQL入手,带你一步一步走上SQL优化之路!
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 cpp 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7 p...
通俗易懂地给女朋友讲:线程池的内部原理
餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小型人工智障。 知识可以运用在不同地方,不一定非是天气预报。
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
英特尔不为人知的 B 面
从 PC 时代至今,众人只知在 CPU、GPU、XPU、制程、工艺等战场中,英特尔在与同行硬件芯片制造商们的竞争中杀出重围,且在不断的成长进化中,成为全球知名的半导体公司。殊不知,在「刚硬」的背后,英特尔「柔性」的软件早已经做到了全方位的支持与支撑,并持续发挥独特的生态价值,推动产业合作共赢。 而对于这一不知人知的 B 面,很多人将其称之为英特尔隐形的翅膀,虽低调,但是影响力却不容小觑。 那么,在...
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹...
面试官:你连RESTful都不知道我怎么敢要你?
干货,2019 RESTful最贱实践
刷了几千道算法题,这些我私藏的刷题网站都在这里了!
遥想当年,机缘巧合入了 ACM 的坑,周边巨擘林立,从此过上了"天天被虐似死狗"的生活… 然而我是谁,我可是死狗中的战斗鸡,智力不够那刷题来凑,开始了夜以继日哼哧哼哧刷题的日子,从此"读题与提交齐飞, AC 与 WA 一色 ",我惊喜的发现被题虐既刺激又有快感,那一刻我泪流满面。这么好的事儿作为一个正直的人绝不能自己独享,经过激烈的颅内斗争,我决定把我私藏的十几个 T 的,阿不,十几个刷题网...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看...
白话阿里巴巴Java开发手册高级篇
不久前,阿里巴巴发布了《阿里巴巴Java开发手册》,总结了阿里巴巴内部实际项目开发过程中开发人员应该遵守的研发流程规范,这些流程规范在一定程度上能够保证最终的项目交付质量,通过在时间中总结模式,并推广给广大开发人员,来避免研发人员在实践中容易犯的错误,确保最终在大规模协作的项目中达成既定目标。 无独有偶,笔者去年在公司里负责升级和制定研发流程、设计模板、设计标准、代码标准等规范,并在实际工作中进行...
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
Nginx 原理和架构
Nginx 是一个免费的,开源的,高性能的 HTTP 服务器和反向代理,以及 IMAP / POP3 代理服务器。Nginx 以其高性能,稳定性,丰富的功能,简单的配置和低资源消耗而闻名。 Nginx 的整体架构 Nginx 里有一个 master 进程和多个 worker 进程。master 进程并不处理网络请求,主要负责调度工作进程:加载配置、启动工作进程及非停升级。worker 进程负责处...
YouTube排名第一的励志英文演讲《Dream(梦想)》
Idon’t know what that dream is that you have, I don't care how disappointing it might have been as you've been working toward that dream,but that dream that you’re holding in your mind, that it’s po...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
相关热词 基于c#波形控件 c# 十进制转十六进制 对文件aes加密vc# c#读取栈中所有的值 c# rsa256加密 好 学c# 还是c++ c# 和java的差距 c# curl网络框架 c# https证书请求 c# 中崎
立即提问