offset

Get div's offsetTop positions in React

十年热恋 提交于 2019-12-03 01:28:23
问题 I am trying to implement a List view in React. What I am trying to achieve is that to store the list headers informations and register the components and register the scroll event. every time when user scroll the window, I'd like to take out the stored div and re-calculate the offsetTop data. The problem now is that, I found the console just print out the initial value (the value is fixed and never changed) offsetTop data never change in onscroll function. Anyone suggest how to get latest

undefined offset PHP error

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am receiving the following error in PHP Notice undefined offset 1: in C:\wamp\www\includes\imdbgrabber.php line 36 Here is the PHP code that causes it: What does the error mean? 回答1: If preg_match did not find a match, $matches is an empty array. So you should check if preg_match found an match before accessing $matches[0] , for example: function get_match($regex,$content) { if (preg_match($regex,$content,$matches)) { return $matches[0]; } else { return null; } } 回答2: How to reproduce this error in PHP: Create an empty array and ask for

Elasticsearch - query_string with wildcards

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have some text in elastic search containing urls in various formats ( http://www , www.) what I want to do is to search for all texts containing e.g., google.com. For the current search I use something like this query: query = { "query" : { "bool" : { "must" : [{ "range" : { "cdate" : { "gt" : dfrom , "lte" : dto } } }, { "query_string" :{ "default_operator" : "AND" , "default_field" : "text" , "analyze_wildcard" : "true" , "query" : searchString } } ] } }} But a query looking like google.com never returns any result, searching

PDO: Invalid parameter number: mixed named and positional parameters

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have come across this warning I've not seen before: Warning: PDOStatement::execute() [pdostatement.execute]: SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters in... Referring to the following PDO query (have simplified the function for ease of reading): $offset = 0 ; $limit = 12 ; function retrieve_search_posts ( $searchfield , $offset , $limit ){ $where = array (); $words = preg_split ( '/[\s]+/' , $searchfield ); array_unshift ( $words , '' ); unset ( $words [ 0 ]); $where_string = implode ( " OR

C/C++ Structure offset

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm looking for a piece of code that can tell me the offset of a field within a structure without allocating an instance of the structure. IE: given struct mstct { int myfield ; int myfield2 ; }; I could write: mstct thing ; printf ( "offset %lu\n" , ( unsigned long )(& thing . myfield2 - & thing )); And get "offset 4" for the output. How can I do it without that "mstct thing" declaration/allocating one? I know that & does not always point at the first byte of the first field of the structure, I can account for that later. 回答1: How

PHP: Illegal string-offset

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My open-source project was working just fine, until I started to work on it after 6 month of break. Updated to latest XAMPP, and start getting tons of weird errors, one of which is as: I have Input class, with a caller method as: server("SERVER_NAME"); ?> Easy right? Well, after I updated PHP with XAMPP, it just doesn't work [edit: it works, with the Warning message] - error is: PHP Warning: Illegal string offset 'SERVER_NAME' in S:\...\kernel\input.php on line 159 line, which corresponds to line of code: return $this->$name[ $this->clean_

Can I have multiple colors in a gnuplot label?

匿名 (未验证) 提交于 2019-12-03 01:00:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have this graph in gnuplot: I want to include totals for each of the three colored line graphs. One possibility is to replace the key with this: Can I plot this with a single label that switches colors? If not then I'd have to use six labels. In that case, how do I determine the coordinates of the labels given that the widths of the strings can vary? I could use a fixed width font and do some computation based on the number of digits in each of the totals but this seems tedious. Is there a more clever way to indicate totals in a graph? 回答1

Python datetime and utc offset conversion ignoring timezone/daylight savings

匿名 (未验证) 提交于 2019-12-03 01:00:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have two operations I want to perform, one the inverse of the other. I have a UNIX timestamp at UTC, say for instance, 1425508527. From this I want to get the year, month, day etc. given a UTC offset. EG. what is the year/month/day/time in (UTC -6 hours)? The answer is March 4, 2015 at 16:35:27. Without providing an offset (or offset zero) the answer should be March 4, 2015 at 22:35:27. Now I have the date at some location, along with the UTC offset. For instance March 4, 2015 at 16:35:27 and the offset (UTC -6 hours). The UNIX UTC

how to get the group commit offset from kafka(0.10.x)

匿名 (未验证) 提交于 2019-12-03 00:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The offsets informations of the group were stored in zookeeper before. Now, in the Kafka Cluster (0.10.x), the offsets informations are stored in the topic which's name is __consumer_offsets . But how could I get the offsets information of the group which I specified? 回答1: For active groups, invoke command below to retrieve the offsets: bin/kafka-consumer-groups.sh --bootstrap-server broker1:9092 --describe --group test-consumer-group For inactive groups, first get the target offset topic partition number by calculating Math.abs(groupId

Spring kafka consumer, seek offset at runtime?

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using the KafkaMessageListenerContainer for consuming from the kafka topic, I have an application logic to process each record which is dependent on other micro services as well. I am now manually committing the offset after each record is processed. But if I the application logic fails I need to seek to the failed offset and keep processing it until it's succeeds. For that I need to do a run time manual seek of the last offset. Is this possible with the KafkaMessageListenerContainer yet ? 回答1: See Seeking to a Specific Offset . In