\n\n\n\n
\n\n\n $(document).ready(function()\n {\n $(\"#content\").load(\"https://vietduc24h.com\");\n })\n\n\n```\n\nWhen your domain is not inside `vietduc24h.com`, you might get some security exception. In order to avoid that, you can host a local proxy here. In PHP, we do this way (`url.php`):\n\n```\n\n\n```\n\nAnd in the script, you need to modify this way:\n\n```\n\n\n```"}}},{"rowIdx":10,"cells":{"qid":{"kind":"number","value":7262136,"string":"7,262,136"},"question":{"kind":"string","value":"![https://farm4.static.flickr.com/3338/4564960137_0d3c09192d_o.png](https://i.stack.imgur.com/Y2gpf.png)\n\ncan we change text in this lightbox\n\nwant to change \"This site requires that you Connect with Facebook.\" and \"Connect with Facebook to Continue\""},"date":{"kind":"string","value":"2011/08/31"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/7262136","https://Stackoverflow.com","https://Stackoverflow.com/users/922283/"],"string":"[\n \"https://Stackoverflow.com/questions/7262136\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/922283/\"\n]"},"response":{"kind":"string","value":"For most (if not all) arithmetic operations, Java will assume you want the maximum defined precision. Imagine if you did this:\n\n```\nlong a = ...;\nint b = ...;\n\nlong c = a % b + Integer.MAX_VALUE;\n\n```\n\nIf Java automatically down-casted `a % b` to an `int`, then the above code would cause an `int` overflow rather than setting `c` to a perfectly reasonable `long` value.\n\nThis is the same reason that performing operations with a `double` and an `int` will produce a `double`. It's much safer to up-cast the least-accurate value to a more accurate one. Then if the programmer knows more than the compiler and wants to down-cast, he can do it explicitly.\n\nUpdate\n------\n\nAlso, after thinking more about this, I'm guessing most CPU architectures don't have operations that combine 32-bit and 64-bit values. So the 32-bit value would need to be promoted to a 64-bit value just to use it as an argument to the CPU's mod operation, and the result of that operation would be a 64-bit value natively. A down-cast to an `int` would add an operation, which has performance implications. Combining that fact with the idea that you might actually want to keep a `long` value for other operations (as I mention above), it really wouldn't make sense to force the result into an `int` unless the developer explicitly wants it to be one."}}},{"rowIdx":11,"cells":{"qid":{"kind":"number","value":45507197,"string":"45,507,197"},"question":{"kind":"string","value":"This is about converting the enumeration values to a string array. I have an enumeration:\n\n```\nenum Weather {\n RAINY, SUNNY, STORMY\n}\n\n```\n\nAnd I want to convert this to a string array with minimal effort and no loops with Java 8+. This is the best I came up with:\n\n```\nArrays.stream(Weather.values()).map(Enum::toString).toArray(String[]::new)\n\n```\n\nAny other and similarly or more convenient ways to do the same thing?"},"date":{"kind":"string","value":"2017/08/04"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/45507197","https://Stackoverflow.com","https://Stackoverflow.com/users/2735286/"],"string":"[\n \"https://Stackoverflow.com/questions/45507197\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/2735286/\"\n]"},"response":{"kind":"string","value":"Original post\n=============\n\nYes, that's a good Java 8 way, but...\n\nThe `toString` can be overridden, so you'd better go with `Weather::name` which returns the name of an enum constant (exactly as declared in the enum declaration) and can't be changed:\n\n```\nStream.of(Weather.values()).map(Weather::name).toArray(String[]::new);\n\n```\n\n---\n\nA bit of generics\n=================\n\nI wrote a helper class to deal with any enum in a generic way:\n\n```\nclass EnumUtils {\n\n public static > String[] getStringValues(Class enumClass) {\n return getStringValuesWithStringExtractor(enumClass, Enum::name);\n }\n\n public static > String[] getStringValuesWithStringExtractor(\n Class enumClass,\n Function extractor\n ) {\n return of(enumClass.getEnumConstants()).map(extractor).toArray(String[]::new);\n }\n\n}\n\n```\n\nHere is a demonstration:\n\n```\nenum Weather {\n RAINY, SUNNY, STORMY;\n\n @Override\n public String toString() {\n return String.valueOf(hashCode());\n }\n\n public static void main(String[] args) {\n System.out.println(Arrays.toString(EnumUtils.getStringValues(Weather.class)));\n System.out.println(Arrays.toString(EnumUtils.getStringValuesWithStringExtractor(Weather.class, Weather::toString)));\n }\n\n}\n\n```\n\nAnd the output: \n\n```\n[RAINY, SUNNY, STORMY]\n[359023572, 305808283, 2111991224]\n\n```"}}},{"rowIdx":12,"cells":{"qid":{"kind":"number","value":26351,"string":"26,351"},"question":{"kind":"string","value":"I was studying for icing and a tailplane stall. I have looked up some internet pages and instrument flying handbook, and found the procedure below.\n\n1. raise flaps to the previous setting. (To reduce down wash from the main wing so that reducing negative angle of attack of the tail and break the stall)\n2. apply nose up elevator pressure (I don't get it. The nose up pressure will make the elevator to go up and wouldn't this increase the negative angle of attack and worsen the stall?)\n3. do not increase airspeed unless it is necessary to avoid a wing stall. (Why shouldn't we increase airspeed?)\n\nSo now I'm trying to understand the reason why should a pilot do such actions. Can you help me out?"},"date":{"kind":"string","value":"2016/03/23"},"metadata":{"kind":"list like","value":["https://aviation.stackexchange.com/questions/26351","https://aviation.stackexchange.com","https://aviation.stackexchange.com/users/6831/"],"string":"[\n \"https://aviation.stackexchange.com/questions/26351\",\n \"https://aviation.stackexchange.com\",\n \"https://aviation.stackexchange.com/users/6831/\"\n]"},"response":{"kind":"string","value":"Lets start with the very basic concepts....\n\nIn most aircraft, the Centre of Gravity (cg) is somewhat forward of the wing or mainplane Centre of Pressure. The exact distance between the cg and the Centre of pressure will depend on aircraft loading, configuration, thrust setting and drag. However, cg forward of the Centre of Pressure produces a nose-down pitching moment. The horizontal stabilizer, or tailplane, then provides a downward force to overcome this normal, nose-down, pitching moment.\nThe tailplane behaves as an ‘upside down’ wing and operates with negative Angle of Attack (AOA) as shown in Figure 1\n\n***Positive and Negative Angle of Attack***\n\n![enter image description here](https://i.stack.imgur.com/60asc.jpg)\n\nFigure 1 - Positive and Negative Angle of Attack\n\nIf the horizontal stabiliser becomes contaminated with ice, airflow separation from the surface can prevent it from providing sufficient downward force or negative lift to balance the aircraft and a nose-down pitch upset can occur.\n\nWhen compared to an aircraft's mainplane, the horizontal stabiliser normally has a thinner aerofoil with a sharper leading edge. Differences in the ice collection efficiency or catch rate between the two surfaces means ice accumulates faster on the horizontal stabiliser and may form before any ice is present on the aircraft's mainplane.\n\nTailplane stall can occur at relatively high speeds, well above the normal 1G stall speed of the mainplane. Typically, tailplane stall induced by icing is most likely to occur near the flap limit speed when the flaps are extended to the landing position, especially when extension is combined with a nose down pitching manoeuvre, airspeed change, power change or flight through turbulence. Aircraft stall warning systems provide warnings based on an uncontaminated mainplane stall so during a tailplane stall induced upset there will be NO artificial stall warning indications, such as a stick shaker, warning horn or the mainplane or flap buffeting normally associated with a mainplane stall.\n\n**Tailplane Stall Aerodynamics**\n\n1. The horizontal stabiliser, or tailplane, of an aircraft is an aerofoil that provides a downward force to overcome the aircraft's normal nose-down pitching moment. The further forward the Centre of Gravity is from the Center of Pressure, the greater the nose down moment and, thus, the greater the amount of down-force that must be generated by the tailplane. This, in turn, requires a greater negative tailplane angle of attack (AOA). angle of attack (AOA).\n[As shown in Figure 1, The tailplane is effectively an upside down aerofoil so an increase in negative tailplane AOA occurs with UP elevator movement or when the aircraft is pitching nose down.]\n2. Accumulation of ice on the tailplane will result in disruption of the normal airflow around that surface and will reduce the critical (or stalling) negative AOA of the horizontal stabiliser.\n3. Ice can accumulate on the tailplane before it begins to accumulate on the mainplane or other parts of the aircraft.\n4. Flaps extension usually moves the mainplane Centre of Pressure aft, lengthening the arm between the Centre of Pressure and the cg and increasing the mainplane nose down moment. More down force is required from the tailplane to counter this moment, necessitating a higher negative tailplane AOA.\n5. Flap extension, especially near the maximum extension speed, increases the negative tailplane AOA due to the increase in downwash, as shown in Figure 2\n6. Increasing the power setting on a propeller driven aircraft may, depending on aircraft configuration and flap settings, increase the downwash and negative tailplane AOA.\n7. When the critical negative AOA of the horizontal stabiliser is exceeded causing it to stall.\n8. Tailplane stall drastically reduces the downward force it produces, creating a rapid aircraft nose-down pitching moment.\n\n**Effect of mainplane flap on downwash**\n\n![enter image description here](https://i.stack.imgur.com/xHo2B.jpg)\n\nFigure 2 - Effect of mainplane flap on downwash\n\nOn aircraft with reversible (unpowered) elevator, tailplane airflow changes caused by ice accretion may lead to an aerodynamic overbalance driving the elevator trailing edge down and pitching the aircraft nose down. This can occur separately from or in combination with the nose down pitching moment caused by tailplane stall. The yoke may be snatched forward out of the pilot’s hands and the control force required for the pilot to return the elevator to neutral or to a nose-up deflection can be significant and potentially greater than the pilot can exert.\n\n**now match with your recovery actions**\n\n1. You have no doubt with your 1st point.\n2. The second point: You have to resist the nose down elevator movement. Once the tailplane is already stalled then you have to assume the elevator has already gone in down position to make your ac nose down. So you have to apply nose up elevator pressure.\n3. You should not increase the airspeed cause it might make the situation worse. Cause in dive with increased airspeed is always difficult to maintain the aircraft control. And you might end up with overstressing the elevator which is not good at all in such condition."}}},{"rowIdx":13,"cells":{"qid":{"kind":"number","value":2093466,"string":"2,093,466"},"question":{"kind":"string","value":"I understand that division by zero isn't allowed, but we merely just multiplied $f(x) = 1$ by $\\frac{x-1}{x-1}$ to get $f(x) = \\frac{x-1}{x-1}$ and $a\\cdot 1 = 1\\cdot a = a$ so they're the **same function** but with **different domain** how is this possible?\n\n*Or in other words* why don't we simplify $f(x) = \\frac{x-1}{x-1}$ to $f(x) = 1$ before plotting the points.\nIs it just defined this way or is there a particular reason ?\n\n**Note:** my book says the domain of $f(x) = 1$ is $\\mathbb{R}$ and the domain of \n$f(x) = \\frac{x-1}{x-1}$ is $\\mathbb{R}$ except $1$."},"date":{"kind":"string","value":"2017/01/11"},"metadata":{"kind":"list like","value":["https://math.stackexchange.com/questions/2093466","https://math.stackexchange.com","https://math.stackexchange.com/users/406041/"],"string":"[\n \"https://math.stackexchange.com/questions/2093466\",\n \"https://math.stackexchange.com\",\n \"https://math.stackexchange.com/users/406041/\"\n]"},"response":{"kind":"string","value":"They are the same *almost everywhere*. But clearly one of them does not exist for $x=1$ (since \"$\\tfrac{0}{0}$\" is undefined), while the other one is simply $1$ at $x=1$.\n\n> \n> I understand that division by zero isn't allowed, but we merely just multiplied f(x) = 1 by (x-1)/(x-1)\n> \n> \n> \n\nYou can multiply by any fraction $\\tfrac{a}{a}$; but not when $a=0$ because the fraction you want to multiply with, isn't even defined then. So multiplying by $\\tfrac{x-1}{x-1}$ is fine, but only valid for $x \\ne 1$.\n\n> \n> why don't we simplify f(x) = (x-1)/(x-1) to f(x) = 1 before plotting the points.\n> Is it just defined this way or is there a particular reason ?\n> \n> \n> \n\nYou can simplify, but recall that simplifying is actually dividing numerator and denominator by the same number: you can simplify $\\tfrac{ka}{kb}$ to $\\tfrac{a}{b}$ by dividing by $k$. But also then: this only works for $k \\ne 0$ since you can't divide by $0$. So \"simplifying\" $\\tfrac{x-1}{x-1}$ to $1$ is fine, for $x-1 \\ne 0$ so for $x \\ne 1$.\n\n---\n\n> \n> **Note:** my book says the domain of $f(x) = 1$ is $\\mathbb{R}$ and the domain of \n> $f(x) = \\frac{x-1}{x-1}$ is $\\mathbb{R}$ except $1$.\n> \n> \n> \n\nTechnically, the domain is a part of the function: it should be given (as well as the codomain). It is very common though that when unspecified, in the context of real-valued functions of a real variable, we assume the 'maximal domain' is intended (and $\\mathbb{R}$ is taken as codomain). Then look at:\n$$f : \\mathbb{R} \\to \\mathbb{R} : x \\mapsto f(x) = 1$$\nand\n$$g : \\mathbb{R} \\setminus \\left\\{ 1 \\right\\} \\to \\mathbb{R} : x \\mapsto g(x) = \\frac{x-1}{x-1}$$\nThe functions $f$ and $g$ are different, but $f(x) = g(x)=1$ for all $x$ except when $x=1$, where $g$ is undefined."}}},{"rowIdx":14,"cells":{"qid":{"kind":"number","value":59133760,"string":"59,133,760"},"question":{"kind":"string","value":"I have following HTML code \n\n```\n
\n \n \n \n Product - ABC\n
\n
\n \n \n \n Product - XYZ\n
\n\n```\n\n[Please check screenshot here](https://i.stack.imgur.com/0iOkd.png)\n\nFrom which \n1) First I need to select/click on \"adapt-checkbox2\" who is left to Span \"Product - ABC\"\nSo I have written code as follows\n\n```\nWebElement selectCompatibleProduct1 = driver.findElement(RelativeLocator.withTagName(\"adapt-checkbox2\").toLeftOf(By.xpath(\"//*[text()='Product - ABC']\")));\n selectCompatibleProduct1.click();\n\n```\n\n**Which is working fine. Its selecting the correct check-box.**\n\n2) But Whenever I tried to select 2nd check-box its not working. Its again clicking/selecting 1st checkbox. \nCode for 2nd checkbox is:-\n\n```\nWebElement selectCompatibleProduct2 = driver.findElement(RelativeLocator.withTagName(\"adapt-checkbox2\").toLeftOf(By.xpath(\"//*[text()='Product - XYZ']\")));\nselectCompatibleProduct2.click();\n\n```\n\nSelenium Version is:- 4.0.0-alpha-3\nPlease can someone help me on this?\nThanks in advance."},"date":{"kind":"string","value":"2019/12/02"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/59133760","https://Stackoverflow.com","https://Stackoverflow.com/users/3189243/"],"string":"[\n \"https://Stackoverflow.com/questions/59133760\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/3189243/\"\n]"},"response":{"kind":"string","value":"Basically, you are getting an **Array of Object** and you want to access the last element of the array, you can **get last array position by** `array.length - 1`, and access the gfs value. if you want to **check whether gfs value is array** not then you can **check by** `typeof gfs`\n\n```js\nvar data= [\r\n {\r\n url: 'https://playy-test.s3.ap-south-1.amazonaws.com/hidden.mp4',\r\n typ: 'base',\r\n pos: 0,\r\n gfs: null\r\n },\r\n {\r\n url: 'https://playy-test.s3.ap-south-1.amazonaws.com/hidden.mp4',\r\n typ: 'node',\r\n pos: 1,\r\n gfs: null\r\n },\r\n {\r\n url: 'https://playy-test.s3.ap-south-1.amazonaws.com/hidden.mp4',\r\n typ: 'node',\r\n pos: 2,\r\n gfs: null\r\n },\r\n {\r\n url: 'https://playy-test.s3.ap-south-1.amazonaws.com/hidden.mp4',\r\n typ: 'boomerang',\r\n pos: 3,\r\n gfs: ['a','b','c']\r\n }\r\n ]\r\n\n // You can access like this\r\n console.log(data[data.length-1].gfs)\n```"}}},{"rowIdx":15,"cells":{"qid":{"kind":"number","value":299700,"string":"299,700"},"question":{"kind":"string","value":"I was following [this tutorial](https://www.youtube.com/watch?v=lrvLnhm6Rqw&list=PLpVC00PAQQxHi-llE9Z8-Q747NYWpsq6t&index=32) on Drupal module development. It talks about database query joins in module development. The tutorial is made for Drupal 8 and I'm using Drupal 9.\n\nThen I made this (look at the join part):\n\n```\n protected function load () {\n $select = Database::getConnection()->select('rsvplist', 'r');\n $select.join('users_field_data', 'u', 'r.uid = u.uid');\n $select->join('node_field_data', 'n', 'r.nid = n.nid');\n $select->addField('u', 'name');\n $select->addField('n', 'title');\n $select->addField('r', 'mail');\n $entries = $select->execute()->fetchAll(\\PDO::FETCH_ASSOC);\n return $entries;\n }\n\n```\n\nBut get this error:\n\n```\nwarning: join() expects at most 2 parameters, 3 given in Drupal\\rsvplist\\Controller\\ReportController->load() (line 24 of /var/www/htdocs/drupal-modules/modules/custom/rsvplist/src/Controller/ReportController.php)\n#0 /var/www/htdocs/drupal-modules/core/includes/bootstrap.inc(305): _drupal_error_handler_real(2, 'join() expects ...', '/var/www/htdocs...', 24)\n#1 [internal function]: _drupal_error_handler(2, 'join() expects ...', '/var/www/htdocs...', 24, Array)\n#2 /var/www/htdocs/drupal-modules/modules/custom/rsvplist/src/Controller/ReportController.php(24): join('users_field_dat...', 'u', 'r.uid = u.uid')\n#3 /var/www/htdocs/drupal-modules/modules/custom/rsvplist/src/Controller/ReportController.php(52): Drupal\\rsvplist\\Controller\\ReportController->load()\n#4 [internal function]: Drupal\\rsvplist\\Controller\\ReportController->report()\n#5 /var/www/htdocs/drupal-modules/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)\n#6 /var/www/htdocs/drupal-modules/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}()\n#7 /var/www/htdocs/drupal-modules/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\\Core\\Render\\Renderer->executeInRenderContext(Object(Drupal\\Core\\Render\\RenderContext), Object(Closure))\n#8 /var/www/htdocs/drupal-modules/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)\n#9 /var/www/htdocs/drupal-modules/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}()\n#10 /var/www/htdocs/drupal-modules/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#11 /var/www/htdocs/drupal-modules/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#12 /var/www/htdocs/drupal-modules/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\\Core\\StackMiddleware\\Session->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#13 /var/www/htdocs/drupal-modules/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\\Core\\StackMiddleware\\KernelPreHandle->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#14 /var/www/htdocs/drupal-modules/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\\page_cache\\StackMiddleware\\PageCache->pass(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#15 /var/www/htdocs/drupal-modules/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\\page_cache\\StackMiddleware\\PageCache->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#16 /var/www/htdocs/drupal-modules/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#17 /var/www/htdocs/drupal-modules/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#18 /var/www/htdocs/drupal-modules/core/lib/Drupal/Core/DrupalKernel.php(706): Stack\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#19 /var/www/htdocs/drupal-modules/index.php(19): Drupal\\Core\\DrupalKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#20 {main}\n\n```\n\nDrupal 9's join don't accepts the third argument:\n\n```\n'r.uid = u.uid'\n\n```\n\nA made some research but I was not able to find an equivalent example about how to use join this way in Drupap 9 documentation and other sources.\n\nHow can I add joins to a query in Drupal 9?"},"date":{"kind":"string","value":"2021/01/25"},"metadata":{"kind":"list like","value":["https://drupal.stackexchange.com/questions/299700","https://drupal.stackexchange.com","https://drupal.stackexchange.com/users/102226/"],"string":"[\n \"https://drupal.stackexchange.com/questions/299700\",\n \"https://drupal.stackexchange.com\",\n \"https://drupal.stackexchange.com/users/102226/\"\n]"},"response":{"kind":"string","value":"In PHP:\n\n* `.` is the string concatenation operator, not the one to call an object method\n* [`join()`](https://www.php.net/manual/en/function.join.php) is an alias for the [`implode()`](https://www.php.net/manual/en/function.implode.php) function, which effectively requires 2 arguments, not 3\n\nThis means that `$select.join('users_field_data', 'u', 'r.uid = u.uid')` (which PHP reads as `$select . join('users_field_data', 'u', 'r.uid = u.uid')`) is:\n\n* Converting the value contained in `$select` to a string\n* Concatenating that string with the string returned by `implode()`\n\nThe arguments accepted by [`implode()`](https://www.php.net/manual/en/function.implode.php) has been changed in the latest PHP versions, but the function has never accepted three arguments, and the first two arguments has never been two strings.\n\nThis explains the error you are getting.\n\nIn Drupal 9, if `$select` is an object implementing [`SelectInterface`](https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Database%21Query%21SelectInterface.php/interface/SelectInterface/9.0.x), [`$select->join()`](https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Database%21Query%21Select.php/function/Select%3A%3Ajoin/9.0.x) is an available method.\n\n```php\npublic function join($table, $alias = NULL, $condition = NULL, $arguments = []) {\n return $this->addJoin('INNER', $table, $alias, $condition, $arguments);\n}\n\n```\n\nInstead of `$select->join()`, you could call `$select->addJoin()`. \n\nThe first method doesn't require to specify the first or the last argument of `$select->addJoin()`, and it's the normally called method.\n\nAs side note, instead of using `$select` on database tables used for entity data, it's generally preferable to use the class returned from [`Drupal::entityQuery()`](https://api.drupal.org/api/drupal/core%21lib%21Drupal.php/function/Drupal%3A%3AentityQuery/9.0.x)."}}},{"rowIdx":16,"cells":{"qid":{"kind":"number","value":74243879,"string":"74,243,879"},"question":{"kind":"string","value":"I want to use UTC dates in my Node.js backend app, however, I need to be able to set time (hours and minutes) in a local/user-specified timezone.\n\nI am looking for a solution in either pure JS or using `dayjs`. I am not looking for a solution in `moment`.\n\nIt seemed like using `dayjs` I could solve this problem quite easily, however, I could not find a way to accomplish this.\n\nI can use UTC timezone by using [`dayjs.utc()`](https://day.js.org/docs/en/plugin/utc) or using [`dayjs.tz(someDate, 'Etc/UTC')`](https://day.js.org/docs/en/timezone/timezone).\n\nWhen using `dayjs.utc()`, I cannot use/specify other timezones for *anything*, therefore I could not find a way to tell `dayjs` I want to set hours/minutes in a particular (non-UTC) timezone.\n\nWhen using `dayjs.tz()`, I still cannot define a timezone of time I want to set to a particular date.\n\n### Example in plain JS\n\nMy locale timezone is `Europe/Slovakia` (CEST = UTC+02 with DST, CET = UTC+1 without DST), however, I want this to work with any timezone.\n\n```js\n// Expected outcome\n// old: 2022-10-29T10:00:00.000Z\n// new time: 10h 15m CEST\n// new: 2022-10-29T08:15:00.000Z\n\n// Plain JS\nconst now = new Date('2022-10-29T10:00:00.000Z')\nconst hours = 10\nconst minutes = 15\nnow.setHours(10)\nnow.setMinutes(15)\n\n// As my default timezone is `Europe/Bratislava`, it seems to work as expected\nconsole.log(now)\n// Output: 2022-10-29T08:15:00.000Z\n\n// However, it won't work with timezones other than my local timezone\n\n```\n\n### (Nearly) a solution\n\n***Update: I posted a working function in [this answer](https://stackoverflow.com/a/74245936/3408342).***\n\nThe following functions seems to work for most test cases, however, it fails for 6 4 cases known to me (any help is greatly appreciated):\n\n* [DST to ST] `now` in DST before double hour, `newDate` in ST during double hour;\n* [DST to ST] `now` in DST during double hour, `newDate` in ST during double hour;\n* [DST to ST] `now` in ST during double hour, `newDate` in DST during double hour;\n* [DST to ST] `now` in ST after double hour, `newDate` in DST during double hour;\n* [ST to DST] `now` in ST before skipped hour, `newDate` in ST in skipped hour;\n* [ST to DST] `now` in DST after skipped hour, `newDate` in ST in skipped hour.\n\nI think the only missing piece is to find a way to check if a particular date in a non-UTC timezone falls into double hour. By *double hour* I mean a situation caused by changint DST to ST, i.e. setting our clock back an hour (e.g. at 3am to 2am → double hour is between `02:00:00.000` and `02:59:59.999`, which occur both in DST and ST).\n\n```js\n/**\n * Set time provided in a timezone\n *\n * @param {Date} [dto.date = new Date()] Date object to work with\n * @param {number} [dto.time.h = 0] Hour to set\n * @param {number} [dto.time.m = 0] Minute to set\n * @param {number} [dto.time.s = 0] Second to set\n * @param {number} [dto.time.ms = 0] Millisecond to set\n * @param {string} [dto.timezone = 'Europe/Bratislava'] Timezone of `dto.time`\n *\n * @return {Date} Date object\n */\nfunction setLocalTime(dto = {\n date: new Date(),\n // TODO: Rename the property to `{h, m, s, ms}`.\n time: {h: 0, m: 0, ms: 0, s: 0},\n timezone: 'Europe/Bratislava'\n}) {\n const defaultTime = {h: 0, m: 0, ms: 0, s: 0}\n const defaultTimeKeys = Object.keys(defaultTime)\n\n // src: https://stackoverflow.com/a/44118363/3408342\n if (!Intl || !Intl.DateTimeFormat().resolvedOptions().timeZone) {\n throw new Error('`Intl` API is not available or it does not contain a list of timezone identifiers in this environment')\n }\n\n if (!(dto.date instanceof Date)) {\n throw Error('`date` must be a `Date` object.')\n }\n\n try {\n Intl.DateTimeFormat(undefined, {timeZone: dto.timezone})\n } catch (e) {\n throw Error('`timezone` must be a valid IANA timezone.')\n }\n\n if (\n typeof dto.time !== 'undefined'\n && typeof dto.time !== 'object'\n && dto.time instanceof Object\n && Object.keys(dto.time).every(v => defaultTimeKeys.indexOf(v) !== -1)\n ) {\n throw Error('`time` must be an object of `{h: number, m: number, s: number, ms: number}` format, where numbers should be valid time values.')\n }\n\n dto.time = Object.assign({}, defaultTime, dto.time)\n\n const getTimezoneOffsetHours = ({date, localisedDate, returnNumber, timezone}) => {\n let offsetString\n\n if (localisedDate) {\n offsetString = localisedDate.find(i => i.type === 'timeZoneName').value.match(/[\\d+:-]+$/)?.[0]\n } else {\n offsetString = new Intl\n .DateTimeFormat('en-GB', {timeZone: timezone, timeZoneName: 'longOffset'})\n .formatToParts(date)\n .find(i => i.type === 'timeZoneName').value.match(/[\\d+:-]+$/)?.[0]\n }\n\n return returnNumber ? offsetString.split(':').reduce((a, c) => /^[+-]/.test(c) ? +c * 60 : a + +c, 0) : offsetString\n }\n\n const pad = (n, len) => `00${n}`.slice(-len)\n\n let [datePart, offset] = dto.date.toLocaleDateString('sv', {\n timeZone: dto.timezone,\n timeZoneName: 'longOffset'\n }).split(/ GMT|\\//)\n\n offset = offset.replace(String.fromCharCode(8722), '-')\n\n const newDateWithoutOffset = `${datePart}T${pad(dto.time.h || 0, 2)}:${pad(dto.time.m || 0, 2)}:${pad(dto.time.s || 0, 2)}.${pad(dto.time.ms || 0, 3)}`\n\n let newDate = new Date(`${newDateWithoutOffset}${offset}`)\n\n const newDateTimezoneOffsetHours = getTimezoneOffsetHours({date: newDate, timezone: dto.timezone})\n\n // Check if timezones of `dto.date` and `newDate` match; if not, use the new timezone to re-create `newDate`\n newDate = newDateTimezoneOffsetHours === offset\n ? newDate\n : new Date(`${newDateWithoutOffset}${newDateTimezoneOffsetHours}`)\n\n if (dto.time.h !== +new Intl.DateTimeFormat('en-GB', {hour: 'numeric', timeZone: dto.timezone}).formatToParts(newDate)?.[0].value) {\n newDate = new Date('')\n }\n\n return newDate\n}\n\nconst timezoneIana = 'Europe/Bratislava'\n\nconst tests = [\n {\n expString: '30/10/2022, 01:55:00 GMT+02:00',\n now: new Date('2022-10-29T23:56:12.006Z'),\n testName: '[DST to ST] `now` in DST before double hour, `newDate` in DST before double hour',\n time: {h: 1, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+02:00',\n now: new Date('2022-10-29T23:56:12.006Z'),\n testName: '[DST to ST] `now` in DST before double hour, `newDate` in DST during double hour',\n time: {h: 2, m: 55}\n },\n // FIXME\n {\n expString: '30/10/2022, 02:55:00 GMT+01:00',\n now: new Date('2022-10-29T23:56:12.006Z'),\n testName: '[DST to ST] `now` in DST before double hour, `newDate` in ST during double hour',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 03:55:00 GMT+01:00',\n now: new Date('2022-10-29T23:56:12.006Z'),\n testName: '[DST to ST] `now` in DST before double hour, `newDate` in ST after double hour',\n time: {h: 3, m: 55}\n },\n {\n expString: '30/10/2022, 01:55:00 GMT+02:00',\n now: new Date('2022-10-30T00:56:12.006Z'),\n testName: '[DST to ST] `now` in DST during double hour, `newDate` in DST before double hour',\n time: {h: 1, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+02:00',\n now: new Date('2022-10-30T00:56:12.006Z'),\n testName: '[DST to ST] `now` in DST during double hour, `newDate` in DST during double hour',\n time: {h: 2, m: 55}\n },\n // FIXME\n {\n expString: '30/10/2022, 02:55:00 GMT+01:00',\n now: new Date('2022-10-30T00:56:12.006Z'),\n testName: '[DST to ST] `now` in DST during double hour, `newDate` in ST during double hour',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 03:55:00 GMT+01:00',\n now: new Date('2022-10-30T00:56:12.006Z'),\n testName: '[DST to ST] `now` in DST during double hour, `newDate` in ST after double hour',\n time: {h: 3, m: 55}\n },\n {\n expString: '30/10/2022, 01:55:00 GMT+02:00',\n now: new Date('2022-10-30T01:56:12.006Z'),\n testName: '[DST to ST] `now` in ST during double hour, `newDate` in DST before double hour',\n time: {h: 1, m: 55}\n },\n // FIXME\n {\n expString: '30/10/2022, 02:55:00 GMT+02:00',\n now: new Date('2022-10-30T01:56:12.006Z'),\n testName: '[DST to ST] `now` in ST during double hour, `newDate` in DST during double hour',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+01:00',\n now: new Date('2022-10-30T01:56:12.006Z'),\n testName: '[DST to ST] `now` in ST during double hour, `newDate` in ST during double hour',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 03:55:00 GMT+01:00',\n now: new Date('2022-10-30T01:56:12.006Z'),\n testName: '[DST to ST] `now` in ST during double hour, `newDate` in ST after double hour',\n time: {h: 3, m: 55}\n },\n {\n expString: '30/10/2022, 01:55:00 GMT+02:00',\n now: new Date('2022-10-30T02:56:12.006Z'),\n testName: '[DST to ST] `now` in ST after double hour, `newDate` in DST before double hour',\n time: {h: 1, m: 55}\n },\n // FIXME\n {\n expString: '30/10/2022, 02:55:00 GMT+02:00',\n now: new Date('2022-10-30T02:56:12.006Z'),\n testName: '[DST to ST] `now` in ST after double hour, `newDate` in DST during double hour',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+01:00',\n now: new Date('2022-10-30T02:56:12.006Z'),\n testName: '[DST to ST] `now` in ST after double hour, `newDate` in ST during double hour',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 03:55:00 GMT+01:00',\n now: new Date('2022-10-30T02:56:12.006Z'),\n testName: '[DST to ST] `now` in ST after double hour, `newDate` in ST after double hour',\n time: {h: 3, m: 55}\n },\n {\n expString: '26/03/2023, 01:55:00 GMT+01:00',\n now: new Date('2023-03-26T00:56:12.006Z'),\n testName: '[ST to DST] `now` in ST before skipped hour, `newDate` in ST before skipped hour',\n time: {h: 1, m: 55}\n },\n // FIXME\n {\n expString: 'Invalid Date',\n now: new Date('2023-03-26T00:56:12.006Z'),\n testName: '[ST to DST] `now` in ST before skipped hour, `newDate` in ST in skipped hour',\n time: {h: 2, m: 55}\n },\n {\n expString: '26/03/2023, 03:55:00 GMT+02:00',\n now: new Date('2023-03-26T00:56:12.006Z'),\n testName: '[ST to DST] `now` in ST before skipped hour, `newDate` in DST after skipped hour',\n time: {h: 3, m: 55}\n },\n {\n expString: '26/03/2023, 01:55:00 GMT+01:00',\n now: new Date('2023-03-26T01:56:12.006Z'),\n testName: '[ST to DST] `now` in DST after skipped hour, `newDate` in ST before skipped hour',\n time: {h: 1, m: 55}\n },\n // FIXME\n {\n expString: 'Invalid Date',\n now: new Date('2023-03-26T01:56:12.006Z'),\n testName: '[ST to DST] `now` in DST after skipped hour, `newDate` in ST in skipped hour',\n time: {h: 2, m: 55}\n },\n {\n expString: '26/03/2023, 03:55:00 GMT+02:00',\n now: new Date('2023-03-26T01:56:12.006Z'),\n testName: '[ST to DST] `now` in DST after skipped hour, `newDate` in DST after skipped hour',\n time: {h: 3, m: 55}\n }\n // TODO: Add a test of a date in DST and ST on a day on which there is no timezone change (two tests in total, one for DST and another for ST).\n]\n\nconst results = tests.map(t => {\n const newDate = setLocalTime({date: t.now, time: t.time, timezone: timezoneIana})\n const newDateString = newDate.toLocaleString('en-GB', {timeZone: timezoneIana, timeZoneName: 'longOffset'})\n const testResult = newDateString === t.expString\n\n if (testResult) {\n console.log(testResult, `: ${t.testName} : ${newDateString}`)\n } else {\n console.log(testResult, `: ${t.testName} : ${newDateString} :`, {newDate, newDateString, test: t})\n }\n\n return testResult\n}).reduce((a, c, i) => {\n if (c) {\n a.passed++\n } else {\n a.failed++\n a.failedTestIds.push(i)\n }\n\n return a\n}, {failed: 0, failedTestIds: [], passed: 0})\n\nconsole.log(results)\n```"},"date":{"kind":"string","value":"2022/10/29"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/74243879","https://Stackoverflow.com","https://Stackoverflow.com/users/3408342/"],"string":"[\n \"https://Stackoverflow.com/questions/74243879\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/3408342/\"\n]"},"response":{"kind":"string","value":"I created the following function that sets the time in a local timezone, for example, if you have `Date` object and you want to change its time (but not date in a particular timezone, regardless of the UTC date of that time), you provide this function with that `Date` object, the required time, timezone and optionally whether you prefer using the new timezone (see below).\n\nI had to add `preferNewTimezone` parameter because off so-called *double hours* (hours in a non-UTC timezone that occur twice because of setting the clock back by an hour), as those failed to output the date (including timezone offset) I expected.\n\nI don’t say it is fast nor perfect, however, it works. :)\n\nI have created 52 tests of this function in `Europe/Bratislava` timezone. They all pass. I presume it’ll work for any timezone. If not and you find an issue or have an improvement/optimisation, I want to hear about it.\n\n```js\n/**\n * Set time provided in a timezone\n *\n * @param {Date} [dto.date = new Date()] Date object to work with\n * @param {boolean} [dto.preferNewTimezone = false] Whether to prefer new timezone for double hours\n * @param {number} [dto.time.h = 0] Hour to set\n * @param {number} [dto.time.m = 0] Minute to set\n * @param {number} [dto.time.s = 0] Second to set\n * @param {number} [dto.time.ms = 0] Millisecond to set\n * @param {string} [dto.timezone = 'Europe/Bratislava'] Timezone of `dto.time`\n *\n * @return {Date} Date object\n */\nfunction setLocalTime(dto = {\n date: new Date(),\n preferNewTimezone: false,\n time: {h: 0, m: 0, ms: 0, s: 0},\n timezone: 'Europe/Bratislava'\n}) {\n const defaultTime = {h: 0, m: 0, ms: 0, s: 0}\n const defaultTimeKeys = Object.keys(defaultTime)\n\n // src: https://stackoverflow.com/a/44118363/3408342\n if (!Intl || !Intl.DateTimeFormat().resolvedOptions().timeZone) {\n throw new Error('`Intl` API is not available or it does not contain a list of timezone identifiers in this environment')\n }\n\n if (!(dto.date instanceof Date)) {\n throw Error('`date` must be a `Date` object.')\n }\n\n try {\n Intl.DateTimeFormat(undefined, {timeZone: dto.timezone})\n } catch (e) {\n throw Error('`timezone` must be a valid IANA timezone.')\n }\n\n if (\n typeof dto.time !== 'undefined'\n && typeof dto.time !== 'object'\n && dto.time instanceof Object\n && Object.keys(dto.time).every(v => defaultTimeKeys.includes(v))\n ) {\n throw Error('`time` must be an object of `{h: number, m: number, s: number, ms: number}` format, where numbers should be valid time values.')\n }\n\n dto.time = Object.assign({}, defaultTime, dto.time)\n\n /**\n * Whether a date falls in double hour in a particular timezone\n *\n * @param {Date} dto.date Date\n * @param {string} dto.timezone IANA timezone\n * @return {boolean} `true` if the specified Date falls in double hour in a particular timezone, `false` otherwise\n */\n const isInDoubleHour = (dto = {date: new Date(), timezone: 'Europe/Bratislava'}) => {\n // Get hour in `dto.timezone` of timezones an hour before and after `dto.date`\n const hourBeforeHour = +new Intl.DateTimeFormat('en-GB', {hour: 'numeric', timeZone: dto.timezone}).formatToParts(new Date(new Date(dto.date).setUTCHours(dto.date.getUTCHours() - 1)))?.[0].value\n const hourDateHour = +new Intl.DateTimeFormat('en-GB', {hour: 'numeric', timeZone: dto.timezone}).formatToParts(dto.date)?.[0].value\n const hourAfterHour = +new Intl.DateTimeFormat('en-GB', {hour: 'numeric', timeZone: dto.timezone}).formatToParts(new Date(new Date(dto.date).setUTCHours(dto.date.getUTCHours() + 1)))?.[0].value\n\n return hourBeforeHour === hourDateHour || hourAfterHour === hourDateHour\n }\n\n const getTimezoneOffsetHours = ({date, localisedDate, returnNumber, timezone}) => {\n let offsetString\n\n if (localisedDate) {\n offsetString = localisedDate.find(i => i.type === 'timeZoneName').value.match(/[\\d+:-]+$/)?.[0]\n } else {\n offsetString = new Intl\n .DateTimeFormat('en-GB', {timeZone: timezone, timeZoneName: 'longOffset'})\n .formatToParts(date)\n .find(i => i.type === 'timeZoneName').value.match(/[\\d+:-]+$/)?.[0]\n }\n\n return returnNumber ? offsetString.split(':').reduce((a, c) => /^[+-]/.test(c) ? +c * 60 : a + +c, 0) : offsetString\n }\n\n /**\n * Pad a number with zeros from left to a required length\n *\n * @param {number} n Number\n * @param {number} len Length\n * @return {string} Padded number\n */\n const pad = (n, len) => `00${n}`.slice(-len)\n\n let [datePart, offset] = dto.date.toLocaleDateString('sv', {\n timeZone: dto.timezone,\n timeZoneName: 'longOffset'\n }).split(/ GMT|\\//)\n\n offset = offset.replace(String.fromCharCode(8722), '-')\n\n const newDateWithoutOffset = `${datePart}T${pad(dto.time.h || 0, 2)}:${pad(dto.time.m || 0, 2)}:${pad(dto.time.s || 0, 2)}.${pad(dto.time.ms || 0, 3)}`\n\n let newDate = new Date(`${newDateWithoutOffset}${offset}`)\n\n const newDateTimezoneOffsetHours = getTimezoneOffsetHours({date: newDate, timezone: dto.timezone})\n\n // Check if timezones of `dto.date` and `newDate` match; if not, use the new timezone to re-create `newDate`\n newDate = newDateTimezoneOffsetHours === offset\n ? newDate\n : new Date(`${newDateWithoutOffset}${newDateTimezoneOffsetHours}`)\n\n // Invalidate the date in `newDate` when the hour defined by user is not the same as the hour of `newDate` formatted in the user-defined timezone\n if (dto.time.h !== +new Intl.DateTimeFormat('en-GB', {hour: 'numeric', timeZone: dto.timezone}).formatToParts(newDate)?.[0].value) {\n newDate = new Date('')\n }\n\n // Check if the user prefers using the new timezone when `newDate` is in double hour\n newDate = dto.preferNewTimezone && !isNaN(newDate) && isInDoubleHour({date: newDate, timezone: dto.timezone})\n ? new Date(`${newDateWithoutOffset}${getTimezoneOffsetHours({date: new Date(new Date(newDate).setUTCHours(dto.date.getUTCHours() + 1)), timezone: dto.timezone})}`)\n : newDate\n\n return newDate\n}\n\nconst timezoneIana = 'Europe/Bratislava'\n\nconst tests = [\n {\n expString: '30/10/2022, 01:55:00 GMT+02:00',\n now: new Date('2022-10-29T23:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[DST to ST] `now` in DST before double hour, `newDate` in DST before double hour [don\\'t prefer new timezone]',\n time: {h: 1, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+02:00',\n now: new Date('2022-10-29T23:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[DST to ST] `now` in DST before double hour, `newDate` in DST during double hour [don\\'t prefer new timezone]',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+02:00',\n now: new Date('2022-10-29T23:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[DST to ST] `now` in DST before double hour, `newDate` in DST during double hour [don\\'t prefer new timezone]',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 03:55:00 GMT+01:00',\n now: new Date('2022-10-29T23:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[DST to ST] `now` in DST before double hour, `newDate` in ST after double hour [don\\'t prefer new timezone]',\n time: {h: 3, m: 55}\n },\n {\n expString: '30/10/2022, 01:55:00 GMT+02:00',\n now: new Date('2022-10-30T00:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[DST to ST] `now` in DST during double hour, `newDate` in DST before double hour [don\\'t prefer new timezone]',\n time: {h: 1, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+02:00',\n now: new Date('2022-10-30T00:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[DST to ST] `now` in DST during double hour, `newDate` in DST during double hour [don\\'t prefer new timezone]',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+02:00',\n now: new Date('2022-10-30T00:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[DST to ST] `now` in DST during double hour, `newDate` in DST during double hour [don\\'t prefer new timezone]',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 03:55:00 GMT+01:00',\n now: new Date('2022-10-30T00:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[DST to ST] `now` in DST during double hour, `newDate` in ST after double hour [don\\'t prefer new timezone]',\n time: {h: 3, m: 55}\n },\n {\n expString: '30/10/2022, 01:55:00 GMT+02:00',\n now: new Date('2022-10-30T01:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[DST to ST] `now` in ST during double hour, `newDate` in DST before double hour [don\\'t prefer new timezone]',\n time: {h: 1, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+01:00',\n now: new Date('2022-10-30T01:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[DST to ST] `now` in ST during double hour, `newDate` in ST during double hour [don\\'t prefer new timezone]',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+01:00',\n now: new Date('2022-10-30T01:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[DST to ST] `now` in ST during double hour, `newDate` in ST during double hour [don\\'t prefer new timezone]',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 03:55:00 GMT+01:00',\n now: new Date('2022-10-30T01:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[DST to ST] `now` in ST during double hour, `newDate` in ST after double hour [don\\'t prefer new timezone]',\n time: {h: 3, m: 55}\n },\n {\n expString: '30/10/2022, 01:55:00 GMT+02:00',\n now: new Date('2022-10-30T02:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[DST to ST] `now` in ST after double hour, `newDate` in DST before double hour [don\\'t prefer new timezone]',\n time: {h: 1, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+01:00',\n now: new Date('2022-10-30T02:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[DST to ST] `now` in ST after double hour, `newDate` in ST during double hour [don\\'t prefer new timezone]',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+01:00',\n now: new Date('2022-10-30T02:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[DST to ST] `now` in ST after double hour, `newDate` in ST during double hour [don\\'t prefer new timezone]',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 03:55:00 GMT+01:00',\n now: new Date('2022-10-30T02:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[DST to ST] `now` in ST after double hour, `newDate` in ST after double hour [don\\'t prefer new timezone]',\n time: {h: 3, m: 55}\n },\n {\n expString: '26/03/2023, 01:55:00 GMT+01:00',\n now: new Date('2023-03-26T00:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[ST to DST] `now` in ST before skipped hour, `newDate` in ST before skipped hour [don\\'t prefer new timezone]',\n time: {h: 1, m: 55}\n },\n {\n expString: 'Invalid Date',\n now: new Date('2023-03-26T00:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[ST to DST] `now` in ST before skipped hour, `newDate` in ST in skipped hour [don\\'t prefer new timezone]',\n time: {h: 2, m: 55}\n },\n {\n expString: '26/03/2023, 03:55:00 GMT+02:00',\n now: new Date('2023-03-26T00:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[ST to DST] `now` in ST before skipped hour, `newDate` in DST after skipped hour [don\\'t prefer new timezone]',\n time: {h: 3, m: 55}\n },\n {\n expString: '26/03/2023, 01:55:00 GMT+01:00',\n now: new Date('2023-03-26T01:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[ST to DST] `now` in DST after skipped hour, `newDate` in ST before skipped hour [don\\'t prefer new timezone]',\n time: {h: 1, m: 55}\n },\n {\n expString: 'Invalid Date',\n now: new Date('2023-03-26T01:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[ST to DST] `now` in DST after skipped hour, `newDate` in ST in skipped hour [don\\'t prefer new timezone]',\n time: {h: 2, m: 55}\n },\n {\n expString: '26/03/2023, 03:55:00 GMT+02:00',\n now: new Date('2023-03-26T01:56:12.006Z'),\n preferNewTimezone: false,\n testName: '[ST to DST] `now` in DST after skipped hour, `newDate` in DST after skipped hour [don\\'t prefer new timezone]',\n time: {h: 3, m: 55}\n },\n {\n expString: '30/10/2022, 01:55:00 GMT+02:00',\n now: new Date('2022-10-29T23:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[DST to ST] `now` in DST before double hour, `newDate` in DST before double hour [prefer new timezone] ',\n time: {h: 1, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+01:00',\n now: new Date('2022-10-29T23:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[DST to ST] `now` in DST before double hour, `newDate` in ST during double hour [prefer new timezone] ',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+01:00',\n now: new Date('2022-10-29T23:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[DST to ST] `now` in DST before double hour, `newDate` in ST during double hour [prefer new timezone] ',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 03:55:00 GMT+01:00',\n now: new Date('2022-10-29T23:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[DST to ST] `now` in DST before double hour, `newDate` in ST after double hour [prefer new timezone] ',\n time: {h: 3, m: 55}\n },\n {\n expString: '30/10/2022, 01:55:00 GMT+02:00',\n now: new Date('2022-10-30T00:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[DST to ST] `now` in DST during double hour, `newDate` in DST before double hour [prefer new timezone] ',\n time: {h: 1, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+01:00',\n now: new Date('2022-10-30T00:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[DST to ST] `now` in DST during double hour, `newDate` in ST during double hour [prefer new timezone] ',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+01:00',\n now: new Date('2022-10-30T00:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[DST to ST] `now` in DST during double hour, `newDate` in ST during double hour [prefer new timezone] ',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 03:55:00 GMT+01:00',\n now: new Date('2022-10-30T00:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[DST to ST] `now` in DST during double hour, `newDate` in ST after double hour [prefer new timezone] ',\n time: {h: 3, m: 55}\n },\n {\n expString: '30/10/2022, 01:55:00 GMT+02:00',\n now: new Date('2022-10-30T01:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[DST to ST] `now` in ST during double hour, `newDate` in DST before double hour [prefer new timezone] ',\n time: {h: 1, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+01:00',\n now: new Date('2022-10-30T01:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[DST to ST] `now` in ST during double hour, `newDate` in ST during double hour [prefer new timezone] ',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+01:00',\n now: new Date('2022-10-30T01:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[DST to ST] `now` in ST during double hour, `newDate` in ST during double hour [prefer new timezone] ',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 03:55:00 GMT+01:00',\n now: new Date('2022-10-30T01:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[DST to ST] `now` in ST during double hour, `newDate` in ST after double hour [prefer new timezone] ',\n time: {h: 3, m: 55}\n },\n {\n expString: '30/10/2022, 01:55:00 GMT+02:00',\n now: new Date('2022-10-30T02:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[DST to ST] `now` in ST after double hour, `newDate` in DST before double hour [prefer new timezone] ',\n time: {h: 1, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+01:00',\n now: new Date('2022-10-30T02:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[DST to ST] `now` in ST after double hour, `newDate` in ST during double hour [prefer new timezone] ',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 02:55:00 GMT+01:00',\n now: new Date('2022-10-30T02:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[DST to ST] `now` in ST after double hour, `newDate` in ST during double hour [prefer new timezone] ',\n time: {h: 2, m: 55}\n },\n {\n expString: '30/10/2022, 03:55:00 GMT+01:00',\n now: new Date('2022-10-30T02:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[DST to ST] `now` in ST after double hour, `newDate` in ST after double hour [prefer new timezone] ',\n time: {h: 3, m: 55}\n },\n {\n expString: '26/03/2023, 01:55:00 GMT+01:00',\n now: new Date('2023-03-26T00:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[ST to DST] `now` in ST before skipped hour, `newDate` in ST before skipped hour [prefer new timezone] ',\n time: {h: 1, m: 55}\n },\n {\n expString: 'Invalid Date',\n now: new Date('2023-03-26T00:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[ST to DST] `now` in ST before skipped hour, `newDate` in ST in skipped hour [prefer new timezone] ',\n time: {h: 2, m: 55}\n },\n {\n expString: '26/03/2023, 03:55:00 GMT+02:00',\n now: new Date('2023-03-26T00:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[ST to DST] `now` in ST before skipped hour, `newDate` in DST after skipped hour [prefer new timezone] ',\n time: {h: 3, m: 55}\n },\n {\n expString: '26/03/2023, 01:55:00 GMT+01:00',\n now: new Date('2023-03-26T01:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[ST to DST] `now` in DST after skipped hour, `newDate` in ST before skipped hour [prefer new timezone] ',\n time: {h: 1, m: 55}\n },\n {\n expString: 'Invalid Date',\n now: new Date('2023-03-26T01:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[ST to DST] `now` in DST after skipped hour, `newDate` in ST in skipped hour [prefer new timezone] ',\n time: {h: 2, m: 55}\n },\n {\n expString: '26/03/2023, 03:55:00 GMT+02:00',\n now: new Date('2023-03-26T01:56:12.006Z'),\n preferNewTimezone: true,\n testName: '[ST to DST] `now` in DST after skipped hour, `newDate` in DST after skipped hour [prefer new timezone] ',\n time: {h: 3, m: 55}\n },\n {\n expString: '01/01/2023, 03:55:00 GMT+01:00',\n now: new Date('2023-01-01T10:00:00.000Z'),\n preferNewTimezone: true,\n testName: '[ST] `now` in ST, `newDate` in ST before `now` [prefer new timezone] ',\n time: {h: 3, m: 55}\n },\n {\n expString: '01/01/2023, 12:00:00 GMT+01:00',\n now: new Date('2023-01-01T10:00:00.000Z'),\n preferNewTimezone: true,\n testName: '[ST] `now` in ST, `newDate` in ST after `now` [prefer new timezone] ',\n time: {h: 12}\n },\n {\n expString: '01/07/2023, 03:55:00 GMT+02:00',\n now: new Date('2023-07-01T10:00:00.000Z'),\n preferNewTimezone: true,\n testName: '[ST] `now` in DST, `newDate` in DST before `now` [prefer new timezone] ',\n time: {h: 3, m: 55}\n },\n {\n expString: '01/07/2023, 12:00:00 GMT+02:00',\n now: new Date('2023-07-01T10:00:00.000Z'),\n preferNewTimezone: true,\n testName: '[ST] `now` in DST, `newDate` in DST after `now` [prefer new timezone] ',\n time: {h: 12}\n },\n {\n expString: '01/01/2023, 03:55:00 GMT+01:00',\n now: new Date('2023-01-01T10:00:00.000Z'),\n preferNewTimezone: false,\n testName: '[ST] `now` in ST, `newDate` in ST before `now` [don\\'t prefer new timezone]',\n time: {h: 3, m: 55}\n },\n {\n expString: '01/01/2023, 12:00:00 GMT+01:00',\n now: new Date('2023-01-01T10:00:00.000Z'),\n preferNewTimezone: false,\n testName: '[ST] `now` in ST, `newDate` in ST after `now` [don\\'t prefer new timezone]',\n time: {h: 12}\n },\n {\n expString: '01/07/2023, 03:55:00 GMT+02:00',\n now: new Date('2023-07-01T10:00:00.000Z'),\n preferNewTimezone: false,\n testName: '[ST] `now` in DST, `newDate` in DST before `now` [don\\'t prefer new timezone]',\n time: {h: 3, m: 55}\n },\n {\n expString: '01/07/2023, 12:00:00 GMT+02:00',\n now: new Date('2023-07-01T10:00:00.000Z'),\n preferNewTimezone: false,\n testName: '[ST] `now` in DST, `newDate` in DST after `now` [don\\'t prefer new timezone]',\n time: {h: 12}\n }\n]\n\nconst results = tests.map(t => {\n const newDate = setLocalTime({date: t.now, preferNewTimezone: t.preferNewTimezone, time: t.time, timezone: timezoneIana})\n const newDateString = newDate.toLocaleString('en-GB', {timeZone: timezoneIana, timeZoneName: 'longOffset'})\n const testResult = newDateString === t.expString\n\n if (testResult) {\n console.log(testResult, `: ${t.testName} : ${newDateString}`)\n } else {\n console.log(testResult, `: ${t.testName} : ${newDateString} :`, {newDate, newDateString, test: t})\n }\n\n return testResult\n}).reduce((a, c, i) => {\n if (c) {\n a.passed++\n } else {\n a.failed++\n a.failedTestIds.push(i)\n }\n\n return a\n}, {failed: 0, failedTestIds: [], passed: 0})\n\nconsole.log(results)\n```"}}},{"rowIdx":17,"cells":{"qid":{"kind":"number","value":199880,"string":"199,880"},"question":{"kind":"string","value":"Is there any way to show a calculated field when I'm filling out a new item for a list?\n\nFor example:\n\nIf I select \"Blue\" in field1, and \"Bird\" in field2,\n\nthen, on the same page where I am filling in information, I can see field3(Calculated field) show a value of \"Blue Jay\"\n\nCurrently, the calculated field doesn't show until I add a new item.\nIt would be even better if the update was in real time, though I don't expect that."},"date":{"kind":"string","value":"2016/11/17"},"metadata":{"kind":"list like","value":["https://sharepoint.stackexchange.com/questions/199880","https://sharepoint.stackexchange.com","https://sharepoint.stackexchange.com/users/61825/"],"string":"[\n \"https://sharepoint.stackexchange.com/questions/199880\",\n \"https://sharepoint.stackexchange.com\",\n \"https://sharepoint.stackexchange.com/users/61825/\"\n]"},"response":{"kind":"string","value":"**As a short answer** : unfortunately , No, the calculated field is calculated after the item added or updated \n\nIf you are using Enterprise Edition of SharePoint then try editing list form with InfoPath and insert field which will do the calculation for you. Make that field read-only and then publish the form.\n\nIn InfoPath , You can \n\n* Add a Textbox as `field3` in your form\n* At `field2` add new a `Action rule` and at **run these action select** `set a fields value`\n* At **Field** Value select Field3\n* At **Value** concatenate your `field1` and `field2`\n\n[![enter image description here](https://i.stack.imgur.com/SN6jP.gif)](https://i.stack.imgur.com/SN6jP.gif)"}}},{"rowIdx":18,"cells":{"qid":{"kind":"number","value":77133,"string":"77,133"},"question":{"kind":"string","value":"There seems to be a lot of software to control (or emulate) mouse input through the keyboard, but what about the opposite?\n\nBasically I'm looking for a way to emulate up/down/left/right clicks with mouse movement, at a fast rate (i.e. lots of very short and quick right clicks while I move the mouse to the right)\n\nIf I have to learn some scripting language to do it, ok, but I don't know if it would even be possible. \n\nNote: This is meant to work on fullscreen, and having a way to turn it on/off with an F# key would be awesome!\n\nThanks for your time :)"},"date":{"kind":"string","value":"2009/11/30"},"metadata":{"kind":"list like","value":["https://superuser.com/questions/77133","https://superuser.com","https://superuser.com/users/19668/"],"string":"[\n \"https://superuser.com/questions/77133\",\n \"https://superuser.com\",\n \"https://superuser.com/users/19668/\"\n]"},"response":{"kind":"string","value":"OK, hopefully supplying a *useful* answer this time, instead of the inverse of the actual answer you wanted...\n\nHow about an AutoHotkey script for [mouse gestures](https://www.autohotkey.com/docs/scripts/MouseGestures.htm)? You haven't indicated what sort of control you require, so perhaps a set of gestures is adequate. If, however, you're looking to essentially replace the whole keyboard with one mouse, well, this may not be the answer you need. Or, good luck memorizing all those gestures. :-D\n\n---\n\nAs is so often the case, [AutoHotkey](https://www.autohotkey.com) is your tool. I won't bore you with extensive review or details, as Google (and even SuperUser) are loaded with info about it.\n\nEDIT: In fact, here's a [ready-made script](https://www.autohotkey.com/docs/scripts/NumpadMouse.htm) that'll enable you to use your numeric keypad as a mouse, with several customizations."}}},{"rowIdx":19,"cells":{"qid":{"kind":"number","value":95407,"string":"95,407"},"question":{"kind":"string","value":"I was playing some math games intended for children, in Japanese, and the subject was 引き算.\n\nThe isolated question came up \"14は10といくつ?\" In the context of 引き算 it makes sense that the answer turned out to be 4, but I don't understand the question structurally. How does it imply \"If you take 10 away from 14, what's left?\" Is this to be understood only in the context? Assuming the と is conditional, my rough translation is \"As for 14... if (you take away) 10... how much(left)?\" with everything in parenthesis being only implied. Is this correct? Are the は and と particles doing what I think?"},"date":{"kind":"string","value":"2022/07/15"},"metadata":{"kind":"list like","value":["https://japanese.stackexchange.com/questions/95407","https://japanese.stackexchange.com","https://japanese.stackexchange.com/users/41549/"],"string":"[\n \"https://japanese.stackexchange.com/questions/95407\",\n \"https://japanese.stackexchange.com\",\n \"https://japanese.stackexchange.com/users/41549/\"\n]"},"response":{"kind":"string","value":"> \n> Is this to be understood only in the context? Assuming the と is conditional\n> \n> \n> \n\nThe と is not conditional, and you can tell that from the word followed by the と.\n\n**The conditional と should follow 活用語の終止形/the terminal form of a conjugatable word**, such as verb, i/na-adjective, auxiliary, eg 「話す」「寒い」「静かだ」「〇〇だ」「~ない」. It *cannot* follow a 体言(unconjugatable word).\n\n> \n> Eg. \n> \n> **食べると**太ってしまう \n> \n> **明るいと**眠れない \n> \n> **静かだと**勉強がはかどる \n> \n> 佐藤さんが**いないと**困る\n> \n> \n> \n\nWhen と is attached to a 体言 (unconjugatable word) as in your example where と is attached to 「10」, it should be the case particle (格助詞). \n\nThe case particle と can attach to words of various part-of-speech (because of its quotative usage). It can be used for saying \"~ and ~\" (enumeration), \"with (someone)\", (same/different) as/from...\" (comparison), \"(saying) that...\"(quotation), etc., as you probably know.\n\n> \n> Eg. \n> \n> **13と**14 -- \"~ and ~\" ← と follows 体言 \n> \n> **リンゴとバナナと**ヨーグルト -- \"~ and ~\" ← と follows 体言 \n> \n> **妹と**一緒に勉強する -- \"with (someone)\" ← と follows 体言 \n> \n> **山田さんと**同じクラス -- \"(same) as ~\" ← と follows 体言 \n> \n> いや**だと**言う -- \"(say) that...\" ← と can follow various words\n> \n> \n> \n\nAnd as you can see, と in the sense \"~ and ~\" would make the most sense in your example.\n\n---\n\n> \n> \"14**は**10**と**いくつ?\"\n> \n> \n> \n\nI'd say the は is the topic marker, or the thematic は (主題の「は」).\n\n> \n> *lit.* **As for** 14, 10 **and** how many (is it)?\n> \n> \n>"}}},{"rowIdx":20,"cells":{"qid":{"kind":"number","value":57779158,"string":"57,779,158"},"question":{"kind":"string","value":"I am using material-ui for my project and I have a need to get the selected text (not the value) and do some parsing. I can't seem to find a way to do this.\n\nHere is what my component looks like:\n\n```\n \n {names.map(row => (\n {row.Name}\n ))}\n \n\n```\n\nhandler looks like this:\n\n```\nconst handleChange = name => event => {\n\n setValues({ ...values, [name]: event.target.value });\n};\n\n```\n\nObviously event.target.value gets my selected value, but I want to also get the selected innerText of the selected index. Any ideas?"},"date":{"kind":"string","value":"2019/09/03"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/57779158","https://Stackoverflow.com","https://Stackoverflow.com/users/8484824/"],"string":"[\n \"https://Stackoverflow.com/questions/57779158\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/8484824/\"\n]"},"response":{"kind":"string","value":"This regex match should get you what you're looking for\n\n```js\nlet regex = /1-[0-9]{3}-[0-9]{3}-[0-9]{4}/ \n\n```"}}},{"rowIdx":21,"cells":{"qid":{"kind":"number","value":2554836,"string":"2,554,836"},"question":{"kind":"string","value":"I have $\\ln (D(x)+1) $. What is the way to prove , that this is a Lebesgue measurable function ?"},"date":{"kind":"string","value":"2017/12/07"},"metadata":{"kind":"list like","value":["https://math.stackexchange.com/questions/2554836","https://math.stackexchange.com","https://math.stackexchange.com/users/503239/"],"string":"[\n \"https://math.stackexchange.com/questions/2554836\",\n \"https://math.stackexchange.com\",\n \"https://math.stackexchange.com/users/503239/\"\n]"},"response":{"kind":"string","value":"You're on the right path.\n\nYou need to argue that $\\sum a^{-1} = \\sum a$ because the map $a \\mapsto a^{-1}$ is a bijection.\n\nThen you can finish as you have done:\n$$\n\\sum a^{-1} = \\sum a = \\frac{(p-1)p}{2} = \\frac{(p-1)}{2}p \\equiv 0 \\bmod p\n$$\nNote where you need $p$ to be odd."}}},{"rowIdx":22,"cells":{"qid":{"kind":"number","value":55620,"string":"55,620"},"question":{"kind":"string","value":"I want to cite an IEEE norm in a document. They provide several way to cite it on their website and in particular `bibTeX`. This is perfect because I use LaTeX.\n\nHowever, the citation does not contain any author field. This raise a warning.\n\nShould I keep this warning or modify the entry to avoid it? And in this case, what should I enter as author?\n\n[Link to the norm page](https://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=4610935&filter%3DAND%28p_Publication_Number%3A4610933%29). In abstract, go to download citation. \n\nFor example bibTeX citation only:\n\n```\n @ARTICLE{4610935,\njournal={IEEE Std 754-2008},\ntitle={IEEE Standard for Floating-Point Arithmetic},\nyear={2008},\npages={1-70},\nkeywords={IEEE standards;floating point arithmetic;programming;IEEE standard;arithmetic formats;computer programming;decimal floating-point arithmetic;754-2008;NaN;arithmetic;binary;computer;decimal;exponent;floating-point;format;interchange;number;rounding;significand;subnormal},\ndoi={10.1109/IEEESTD.2008.4610935},\nmonth={Aug},}\n\n```"},"date":{"kind":"string","value":"2015/10/07"},"metadata":{"kind":"list like","value":["https://academia.stackexchange.com/questions/55620","https://academia.stackexchange.com","https://academia.stackexchange.com/users/14659/"],"string":"[\n \"https://academia.stackexchange.com/questions/55620\",\n \"https://academia.stackexchange.com\",\n \"https://academia.stackexchange.com/users/14659/\"\n]"},"response":{"kind":"string","value":"I assume that the venue you want to publish in follows the [IEEE editorial style guide](https://www.ieee.org/documents/style_manual.pdf). On page 38, the guide shows how to reference standards:\n\n> \n> Basic Format:\n> \n> \n> [1] *Title of Standard*, Standard number, date.\n> \n> \n> Examples:\n> \n> \n> [1] *IEEE Criteria for Class IE Electric Systems*, IEEE\n> Standard 308, 1969.\n> \n> \n> [2] *Letter Symbols for Quantities*, ANSI Standard\n> Y10.5-1968.\n> \n> \n> \n\nSo this is what the end result should look like. If this *is* your end result, you can disregard warnings.\n\nHowever, I'd assume that BibTeX issues warnings about missing authors because it *expects* authors in the particular entry type you are using. You may need to recode your BibTeX file entry from, say, `@Article` to `@Techreport`. If you run into problems with (Bib)TeX, [tex.SE](https://tex.stackexchange.com/) may be helpful."}}},{"rowIdx":23,"cells":{"qid":{"kind":"number","value":195501,"string":"195,501"},"question":{"kind":"string","value":"Is it coherent to suggest that it is possible to iterate, one-by-one, through every single item in an infinite set? Some have suggested that it is possible to iterate (or count) completely through an infinite set with no start (or lower bound), making infinite regress a genuinely possible reality.\n\nMathematically, is this possible?\n\nI don't know much about math proofs, so the more basic (with the least symbols) you can keep your answer, the more likely I will understand and appreciate it.\n\nThank you very much!\n\nADDENDUM\n\nWhen I write an infinite loop into my computer code, the code begins to execute and will never complete it's looping (unless it crashes or I stop it). I am wondering if it is mathematically possible, adding one to another, to ever arrive at the completion of an infinite set, like the set of negative integers, or will it continue permanently?"},"date":{"kind":"string","value":"2012/09/14"},"metadata":{"kind":"list like","value":["https://math.stackexchange.com/questions/195501","https://math.stackexchange.com","https://math.stackexchange.com/users/40191/"],"string":"[\n \"https://math.stackexchange.com/questions/195501\",\n \"https://math.stackexchange.com\",\n \"https://math.stackexchange.com/users/40191/\"\n]"},"response":{"kind":"string","value":"We may count through the integers by listing them $0,1,-1,2,-2,\\dots$. This is an infinite set without a lower bound. In general, if you have a bijection $f:\\mathbb{N} \\to X$ where $X$ is an infinite set, then you can \"iterate\" through them by listing $f(1),f(2),f(3), \\dots$."}}},{"rowIdx":24,"cells":{"qid":{"kind":"number","value":69581492,"string":"69,581,492"},"question":{"kind":"string","value":"I have string column in my `df` table, like this below:\n\n```\nd = {'col1': ['1.2', '3.4', '1.99', '0.14', '2.9', '', '2.3']}\ndf = pd.DataFrame(data=d)\ndf\n\n```\n\n[![enter image description here](https://i.stack.imgur.com/X2WXJ.png)](https://i.stack.imgur.com/X2WXJ.png)\n\nI would like to convert this column, so that all values ​​contain two decimal places, but **without changing the type of this column to numeric type**.\n\nExpected output - a string column with values:\n\n[![enter image description here](https://i.stack.imgur.com/3Aefa.png)](https://i.stack.imgur.com/3Aefa.png)\n\nI am a little new to Python, I tried padding 0 [How to pad a numeric string with zeros to the right in Python?](https://stackoverflow.com/questions/40999973/how-to-pad-a-numeric-string-with-zeros-to-the-right-in-python/46021306) depending on the length of the value in the column, but it actually didn't work.\n\nDo you have idea how to handle it?"},"date":{"kind":"string","value":"2021/10/15"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/69581492","https://Stackoverflow.com","https://Stackoverflow.com/users/16734748/"],"string":"[\n \"https://Stackoverflow.com/questions/69581492\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/16734748/\"\n]"},"response":{"kind":"string","value":"Use [`str.ljust`](https://pandas.pydata.org/docs/reference/api/pandas.Series.str.ljust.html):\n\n```\ndf['col1'] = df['col1'].str.ljust(4, '0')\n\n```\n\noutput:\n\n```\n col1\n0 1.20\n1 3.40\n2 1.99\n3 0.14\n4 2.90\n5 2.30\n\n```\n\nTo leave empty rows intact:\n\n```\ndf['col1'] = df['col1'].mask(df['col1'].astype(bool), df['col1'].str.ljust(4, '0'))\n\n```\n\noutput:\n\n```\n col1\n0 1.20\n1 3.40\n2 1.99\n3 0.14\n4 2.90\n5 \n6 2.30\n\n```\n\nNB. to get the max string length: `df['col1'].str.len().max()` -> `4`"}}},{"rowIdx":25,"cells":{"qid":{"kind":"number","value":2435039,"string":"2,435,039"},"question":{"kind":"string","value":"Sorry the title's so convoluted... I must've tried for ten minutes to get a good, descriptive title! Basically, here's the scenario. \n\nLet's say a user can pick fifty different hat colors and styles to put on an avatar. The avatar can move his head around, so we'd need the same types of movements in the symbol for when that happens. \n\nAdditionally, it gets which hat should be on the 'avatar' from a database. The problem is that we can't just make 50 different frames with a different hat on each. And each hat symbol will have the same movements, it'll just be different styles, colors and sizes. \n\nSo how can I make one variable that is the HAT, that way we can just put the appropriate hat symbol into the variable and always be able to call Hat.gotoAndplay('tip\\_hat') or any other generic functions.... Does that make sense? \n\nHope that's not too confusing. Sorry, I'm not great at the visual Flash stuff, but it's gotta be done! Thanks!"},"date":{"kind":"string","value":"2010/03/12"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/2435039","https://Stackoverflow.com","https://Stackoverflow.com/users/48957/"],"string":"[\n \"https://Stackoverflow.com/questions/2435039\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/48957/\"\n]"},"response":{"kind":"string","value":"[debu's suggestion](https://stackoverflow.com/questions/2435039/best-way-to-be-able-to-pick-multiple-colors-designs-of-symbols-dynamically-from-f/2435101#2435101) about a hat container makes sense in order to separate out control of the hat movement.\n\nYou could take this further by separating out different aspects of the appearance of each hat (not just the colours, but also style, pattern, size, orientation etc) - this would allow you produce a wide variety of different hats from just a few parameters.\n\nSo for example 6 styles x 4 patterns x 8 colours = 192 different hats (without having to draw each one!)\n\n[![parametric hats diagram](https://i.stack.imgur.com/dHyh6.jpg)](https://i.stack.imgur.com/dHyh6.jpg) \n\n(source: [webfactional.com](https://roi.webfactional.com/img/so/hats.jpg))"}}},{"rowIdx":26,"cells":{"qid":{"kind":"number","value":26678924,"string":"26,678,924"},"question":{"kind":"string","value":"I'm writing a Linux device driver using kernel 3.13.0 and I'm confused as to why I'm getting this warning.\n\n```\nwarning: initialization from incompatible pointer type [enabled by default]\n .read = read_proc,\n ^\nwarning: (near initialization for ‘proc_fops.read’) [enabled by default]\n\n```\n\nAs far as I can tell my file\\_operations setup for the proc functions are identical to the device functions. I can read/write to /dev/MyDevice with no issue and there are no warnings. The proc write function does not throw a warning, only the read. What did I do wrong?\n\n```\n/*****************************************************************************/\n//DEVICE OPERATIONS\n/*****************************************************************************/ \nstatic ssize_t dev_read(struct file *pfil, char __user *pBuf, size_t\n len, loff_t *p_off)\n{\n //Not relevant to this question\n}\n\nstatic ssize_t dev_write(struct file *pfil, const char __user *pBuf,\n size_t len, loff_t *p_off)\n{\n //Not relevant to this question\n}\n\nstatic struct file_operations dev_fops =\n{ //None of these cause a warning but the code is identical the proc code below\n .owner = THIS_MODULE,\n .read = dev_read,\n .write = dev_write\n};\n\n/*****************************************************************************/\n//PROCESS OPERATIONS\n/*****************************************************************************/\nstatic int read_proc(struct file *pfil, char __user *pBuf, size_t\n len, loff_t *p_off)\n{\n //Not relevant to this question\n}\n\nstatic ssize_t write_proc(struct file *pfil, const char __user *pBuf,\n size_t len, loff_t *p_off)\n{\n //Not relevant to this question\n}\n\nstruct file_operations proc_fops = \n{\n .owner = THIS_MODULE,\n .write = write_proc,\n .read = read_proc, //This line causes the warning.\n};\n\n```\n\nEDIT: So the answer is that I'm an idiot for not seeing the \"int\" versus \"ssize\\_t\". Thank you everyone! Both Codenheim and Andrew Medico had the correct answer at roughly the same time but I chose Medico's because it's more pedantic and obvious for future visitors."},"date":{"kind":"string","value":"2014/10/31"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/26678924","https://Stackoverflow.com","https://Stackoverflow.com/users/289746/"],"string":"[\n \"https://Stackoverflow.com/questions/26678924\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/289746/\"\n]"},"response":{"kind":"string","value":"The return type of your `read_proc` function (which throws the warning) does not match the the function that compiles cleanly.\n\n```\nstatic ssize_t dev_read(struct file *pfil, char __user *pBuf, size_t len, loff_t *p_off)\n\n```\n\nvs.\n\n```\nstatic int read_proc(struct file *pfil, char __user *pBuf, size_t len, loff_t *p_off)\n\n```\n\n`ssize_t` and `int` may be different sizes. Your function's return type should be `ssize_t`."}}},{"rowIdx":27,"cells":{"qid":{"kind":"number","value":8499,"string":"8,499"},"question":{"kind":"string","value":"I am writing an application, running on a server, where multiple users access data from a database which is AES encrypted with a master secret. The master secret itself is initially randomly generated, and then AES encrypted with a user-secret to yield a 'user-hash'. The master secret is never stored, but the user-hash is stored in a database.\nWhen a user enters his user-secret, the user-hash is decrypted to temporarily (on the fly) yield the master-secret which is used to decrypt the data. The data is then send to the user.\n\nIf a user is deleted, the user-hash is deleted. He may have saved decrypted data, but cannot decrypt further data.\n\nThe question is: How safe is the master-secret in this constellation? If the database is compromised, an attacker has access to the user-hash and the encrypted data. If the attacker was a user, he may also have decrypted data. Will he then be able to break the master-secret?"},"date":{"kind":"string","value":"2013/05/30"},"metadata":{"kind":"list like","value":["https://crypto.stackexchange.com/questions/8499","https://crypto.stackexchange.com","https://crypto.stackexchange.com/users/7065/"],"string":"[\n \"https://crypto.stackexchange.com/questions/8499\",\n \"https://crypto.stackexchange.com\",\n \"https://crypto.stackexchange.com/users/7065/\"\n]"},"response":{"kind":"string","value":"If a user has a copy of both the encrypted and decrypted data, he is in a position to perform at least a [known-plaintext attack](https://en.wikipedia.org/wiki/Known-plaintext_attack). If users can submit arbitrary plaintexts for encryption, they can conduct a [chosen-plaintext attack](https://en.wikipedia.org/wiki/Chosen-plaintext_attack), which is stronger. In a chosen-plaintext attack, the attacker can submit any number of plaintexts and can retrieve the corresponding ciphertext.\n\nAll reasonable encryption algorithms are resistant to chosen-plaintext attacks, and AES is considered a reasonable encryption algorithm. Someone in possession of some (plaintext, ciphertext) pairs cannot encrypt or decrypt other messages (except sometimes messages derived from the known messages if a bad mode is used). In particular, no matter how many known plaintexts and ciphertexts the attacker is, he has no method to obtain the key that is better than brute force (trying all possible $2^{128}$ keys).\n\nDo note that deleting the private secret does not delete the master secret. The master secret can still be recovered from backup copies of the private secret that weren't deleted, from other users' private secret, or from extant copies of the master secret."}}},{"rowIdx":28,"cells":{"qid":{"kind":"number","value":2055713,"string":"2,055,713"},"question":{"kind":"string","value":"In his book \"Men of Mathematics\", Eric Temple Bell repeatedly makes the point that a student of mathematics must read the classics.\n\nMy question is what are some classic books in mathematics ( Dictionary definition : judged over a period of time to be of the highest quality and outstanding of its kind.) that can be used by a high school/undergraduate student to start the study of higher mathematics? \n\nSome subjects I would like reference in particular, otherwise state any book you consider a classic, are:\n\n1) Analysis\n 2) Abstract algebra\n 3) Linear Algebra\n 4) Number theory\n5) Combinatorics and Graph theory, etc."},"date":{"kind":"string","value":"2016/12/12"},"metadata":{"kind":"list like","value":["https://math.stackexchange.com/questions/2055713","https://math.stackexchange.com","https://math.stackexchange.com/users/-1/"],"string":"[\n \"https://math.stackexchange.com/questions/2055713\",\n \"https://math.stackexchange.com\",\n \"https://math.stackexchange.com/users/-1/\"\n]"},"response":{"kind":"string","value":"I don’t agree with Bell on this point: one may well learn better and more easily from a book that is *not* generally considered a classic. For example, most people have never even heard of John Greever’s modified Moore method textbook *Theory and Examples of Point-Set Topology*, but for me it was the ideal introduction to the field. That said, I can nevertheless name a few examples.\n\nFor someone of my generation I.N. Herstein’s *Topics in Algebra* is a classic introduction to abstract algebra. The first volume of William J. LeVeque’s two-volume *Topics in Number Theory* is a classic at the higher end of the undergraduate level; Underwood Dudley’s *Elementary Number Theory* is a classic at the lower end."}}},{"rowIdx":29,"cells":{"qid":{"kind":"number","value":36447958,"string":"36,447,958"},"question":{"kind":"string","value":"I'm using the [jQuery Validate Plugin](https://jqueryvalidation.org/validate) and I want to be able to hide the error messages next to my inputs and have a main error message at the bottom, I have this working kind of but the error messages are showing next to my input fields. (Obviously I would clean up the styling if i was using it).\n\nAs you can see at the bottom it is telling me there are 4 errors see details below.. I want this to stay but not the error messages and styling above?\n\n[![enter image description here](https://i.stack.imgur.com/taT8w.png)](https://i.stack.imgur.com/taT8w.png)\n\n```\n$( \".form-group-rules\" ).validate({ \n rules: {\n rule_name: {\n required: true\n },\n rule_desc: {\n required: false\n },\n rule_type: {\n required: true\n }, \n vali_type: {\n required: true\n },\n tran_type: {\n required: true\n },\n vali_fields: {\n required: true\n },\n acct_sel: {\n required: true\n } \n }, \n messages: {\n rule_name: \"Please enter a rule name\",\n rule_type: \"Please select a rule type\", \n vali_fields: \"Please select a validation field\",\n tran_type: \"Please select at least 1 transaction type\",\n vali_type: \"Please select a valiation type\",\n acct_sel: \"Please select at least 1 account\"\n },\n showErrors: function(errorMap, errorList) {\n $(\".error-container\").html(\"Your form contains \"\n + this.numberOfInvalids()\n + \" errors, see details below.\");\n this.defaultShowErrors();\n } \n});\n\n```"},"date":{"kind":"string","value":"2016/04/06"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/36447958","https://Stackoverflow.com","https://Stackoverflow.com/users/4532646/"],"string":"[\n \"https://Stackoverflow.com/questions/36447958\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/4532646/\"\n]"},"response":{"kind":"string","value":"May be use the Validator method\n\n```\nerrorPlacement: function(error,element) {\n return true;\n }\n\n```\n\nIt will not append the error to the inputs."}}},{"rowIdx":30,"cells":{"qid":{"kind":"number","value":9994676,"string":"9,994,676"},"question":{"kind":"string","value":"I have checked out many pages but most of the tutorials and script return an error code with this type of JSON output. So how would I be able to extract the data from this JSON in Java?:\n\n```\n[\n {\n \"user\":{\"id\":\"1\",\"username\":\"user1\"},\n \"item_name\":\"item1\",\n \"custom_field\":\"custom1\"\n },\n {\n \"user\":{\"id\":\"2\",\"username\":\"user2\"},\n \"item_name\":\"item2\",\n \"custom_field\":\"custom2\"\n },\n {\n \"user\":{\"id\":\"3\",\"username\":\"user3\"},\n \"item_name\":\"item3\",\n \"custom_field\":\"custom3\"\n }\n]\n\n```"},"date":{"kind":"string","value":"2012/04/03"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/9994676","https://Stackoverflow.com","https://Stackoverflow.com/users/1310575/"],"string":"[\n \"https://Stackoverflow.com/questions/9994676\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/1310575/\"\n]"},"response":{"kind":"string","value":"If you want to use Gson, then first you declare classes for holding each element and sub elements:\n\n```\npublic class MyUser {\n public String id;\n public String username;\n}\n\npublic class MyElement {\n public MyUser user;\n public String item_name;\n public String custom_field;\n}\n\n```\n\nThen you declare an array of the outermost element (because in your case the JSON object is a JSON array), and assign it:\n\n```\nMyElement[] data = gson.fromJson (myJSONString, MyElement[].class);\n\n```\n\nThen you simply access the elements of `data`.\n\nThe important thing to remember is that the names and types of the attributes you declare should match the ones in the JSON string. e.g. \"id\", \"item\\_name\" etc."}}},{"rowIdx":31,"cells":{"qid":{"kind":"number","value":10839,"string":"10,839"},"question":{"kind":"string","value":"I am reading Novuum Lumen Chemicum with the help of Waite’s English translation. () The following passage I cannot understand clearly. It seems that Waite had skipped this.(org.: Musaeum Hermeticum, Frankfurt, 1677, p.545 – page number misprinted as 454)\n\n> \n> Nos dum illam quaerimus alia invenimus: & nisi ita usitata esset procreatio humana, & natura in eo suum jus teneret, jam vix non deviaremus. \n> \n> \n> \n\nThe sentences before and after this one:\n\n> \n> Si hoc revivisceret ipse Philosophorum pater Hermes, & subtilis ingenii Geber, cum profundissimo RAYMUNDO LULLIO, non pro Philosophis, sed potius pro discipulis a nostris Chemistis haberentur: Nescirent tot hodie usitatas destilationes, tot circulationes, tot calcinationes, & tot alia innumerabilia alia Artistarum opera, quae ex illorum scriptis hujus saeculi homines invenerunt & excogitarunt. Unicum tantum nobis deest, ut id sciamus quod ipsi fecerunt, lapidem videlicet Philosophorum seu Tincturam Physicam. Nos dum illam quaerimus alia invenimus: & nisi ita usitata esset procreatio humana, & natura in eo suum jus teneret, jam vix non deviaremus. Sed, ut revertar ad propositum, promisi in hoc primo tractatu Naturam explicare; ne nos a simplici via vera, vana deflectat imaginatio. \n> \n> \n> \n\nI would appreciate any help."},"date":{"kind":"string","value":"2019/05/24"},"metadata":{"kind":"list like","value":["https://latin.stackexchange.com/questions/10839","https://latin.stackexchange.com","https://latin.stackexchange.com/users/2954/"],"string":"[\n \"https://latin.stackexchange.com/questions/10839\",\n \"https://latin.stackexchange.com\",\n \"https://latin.stackexchange.com/users/2954/\"\n]"},"response":{"kind":"string","value":"To supplement, I've located [a different published (i.e. professional) English translation](https://archive.org/details/alchymytakenouto00sedz): that of a Dr John French, published in 1674. Here's what he has to say [for this section](https://archive.org/details/alchymytakenouto00sedz/page/2):\n\n> \n> If *Hermes* himfelf, the Father of Philosophers, should now be alive, and subtil-witted *Geber*, together with most profound *Raimundus Lullius*, they would not be accounted by our Chymists for Philosophers, but rather for Scholars: They would be ignorant of those so many Distillations, so many Circulations, so many Calcinations, and so many other innumerable Operations of Artists now adays used, which men of this age devised, and found out of their Writings. There is one only thing wanting to us, that is, to know that which they effected, *viz.* the Philosophers Stone, or Physical Tincture **we whilst we seek that, find out other things: and unless the Procreation of Man were so usual as it is, and Nature did in that thing still observe her own Law, and Rules we should scarce not but err.** But to return to what I intended; I promised in this first Treatise to explain Nature, lest every idle fancy should turn us aside from the true and plain way.\n> \n> \n> \n\n(Errors as in the original.)\n\nI'm afraid I'm not sure what \"unless the Procreation of Man were so usual as it is\" is supposed to mean: it's a very literal translation of the Latin, but doesn't really seem to make a lot of sense."}}},{"rowIdx":32,"cells":{"qid":{"kind":"number","value":72026622,"string":"72,026,622"},"question":{"kind":"string","value":"I have an array of objects:\n\n```\nthis.array = [{name: null}, {name: null}, {name: null}]\n\n```\n\nand array of reservend names:\n\n```\nthis.reserved = [\"name2\", \"name3\"]\n\n```\n\nI loop through array and try to set uniques name (not included inside `reserved` array)\n\n```\n for (let i = 0; i < array.length; i++) {\n this.setDefaultName(array[i], 1);\n }\n\n private setDefaultName(obj, index){\n if (!this.reserved.includes(`name${index}`)) {\n obj.name = `name${index}`;\n this.reserved.push(`name${index}`);\n } else {\n return this.setDefaultName(obj, index + 1);\n }\n }\n\n```\n\nAfter that all objects from array have name \"name3\". The expected result is to have sequence unique name: \"name1\", \"name4\", \"name5\".\nCould anyone help me?"},"date":{"kind":"string","value":"2022/04/27"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/72026622","https://Stackoverflow.com","https://Stackoverflow.com/users/16078729/"],"string":"[\n \"https://Stackoverflow.com/questions/72026622\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/16078729/\"\n]"},"response":{"kind":"string","value":"**Update:**\n\nIn the meantime, GitLab have released a new version of their Docker Machine fork which upgrades the default AMI to Ubuntu 20.04. That means that upgrading Docker Machine to the latest version released by GitLab will fix the issue without changing your runner configuration. The latest release can be found [here](https://gitlab-docker-machine-downloads.s3.amazonaws.com/main/index.html).\n\n**Original Workaround/fix:**\n\nExplicitly specify the AMI in your runner configuration and do not rely on the default one anymore, i.e. add something like `\"amazonec2-ami=ami-02584c1c9d05efa69\"` to your `MachineOptions`:\n\n```\nMachineOptions = [\n \"amazonec2-access-key=xxx\",\n \"amazonec2-secret-key=xxx\",\n \"amazonec2-region=eu-central-1\",\n \"amazonec2-vpc-id=vpc-xxx\",\n \"amazonec2-subnet-id=subnet-xxx\",\n \"amazonec2-use-private-address=true\",\n \"amazonec2-tags=runner-manager-name,gitlab-aws-autoscaler,gitlab,true,gitlab-runner-autoscale,true\",\n \"amazonec2-security-group=ci-runners\",\n \"amazonec2-instance-type=m5.large\",\n \"amazonec2-ami=ami-02584c1c9d05efa69\", # Ubuntu 20.04 for amd64 in eu-central-1\n \"amazonec2-request-spot-instance=true\",\n \"amazonec2-spot-price=0.045\"\n]\n\n```\n\nYou can get a list of Ubuntu AMI IDs [here](https://cloud-images.ubuntu.com/locator/ec2/). Be sure to select one that fits your AWS region and instance architecture and [is supported by Docker](https://docs.docker.com/engine/install/ubuntu/#os-requirements).\n\n**Explanation:**\n\nThe default AMI that GitLab Runner / the Docker Machine EC2 driver use is Ubuntu 16.04. The install script for Docker, which is available on and which Docker Machine relies on, seems to have stopped supporting Ubuntu 16.04 recently. Thus, the installation of Docker fails on the EC2 instance spawned by Docker Machine and the job cannot run.\n\nSee also [this](https://gitlab.com/gitlab-org/ci-cd/docker-machine/-/issues/69) GitLab issue.\n\n[Azure](https://gitlab.com/gitlab-org/ci-cd/docker-machine/-/issues/71) and [GCP](https://gitlab.com/gitlab-org/ci-cd/docker-machine/-/issues/70) suffer from similar problems."}}},{"rowIdx":33,"cells":{"qid":{"kind":"number","value":32251446,"string":"32,251,446"},"question":{"kind":"string","value":"I am developing an Android application and I have trouvble making javascript work.\nHere is my main activity code :\n\n```\n protected void onCreate(Bundle savedInstanceState) {\n Log.i(TAG, \"create LocalDialogActivity\");\n\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_local_dialog);\n\n webView = (WebView)findViewById(R.id.local_dialog_webview);\n webView.setWebChromeClient(new WebChromeClient());\n\n webView.getSettings().setUseWideViewPort(true);\n webView.getSettings().setLoadWithOverviewMode(true);\n\n webView.getSettings().setSupportZoom(true);\n webView.getSettings().setBuiltInZoomControls(true);\n webView.getSettings().setDisplayZoomControls(false);\n\n webView.getSettings().setJavaScriptEnabled(true);\n webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);\n\n }\n}\n\nprivate class WebAppInterface {\n @JavascriptInterface\n public void validate() {\n //do some action...\n }\n\n @JavascriptInterface\n public void cancel() {\n //do some actions...\n }\n}\n\n```\n\nhere is my html code :\n\n```\n\n\n \n \n \n \n \n\n
\n
\n\n
\n \n \n
\n\n
\n
\n\n\n\n\n```\n\nWhen I click on my buttons, the functions validate() and cancel() doesn't work.\n\nhere is my javascript code :\n\n```\nfunction validate() {\n Interface.validate();\n}\n\nfunction cancel() {\n Interface.cancel();\n}\n\n```\n\nInterface is my javascriptInterface in my Android code.\n\nAny ideas would be welcome."},"date":{"kind":"string","value":"2015/08/27"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/32251446","https://Stackoverflow.com","https://Stackoverflow.com/users/3664585/"],"string":"[\n \"https://Stackoverflow.com/questions/32251446\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/3664585/\"\n]"},"response":{"kind":"string","value":"Just add \n\n```\nwebView.getSettings().setDomStorageEnabled(true);\n\n```"}}},{"rowIdx":34,"cells":{"qid":{"kind":"number","value":49336275,"string":"49,336,275"},"question":{"kind":"string","value":"Prestashop 1.6 has some strange functions. One of them is: \n\n```\n\\themes\\my_theme\\js\\autoload\\15-jquery.uniform-modified.js\n\n```\n\nWhich add span to radio, input button. For example:\n\n```\n
\n \n \n \n
\n\n```\n\nIf this span has class checked then checkbox is checked. the problem is when quest user want buy products without create a account. The user need to provide some information about his self. In the end click on \"save\" button\n\n```\n\n\n```\n\nWhen I click this button the html is change to:\n\n```\n

\n \n

\n\n```\n\nthe question is. How can I call function which add span to input field after click on this button. For now I have something like this:\n\n```\n$('#submitGuestAccount').click(function () {\n\n});\n\n```\n\nBelow I past all content from:\n[view-source:https://dev.suszek.info/themes/default-bootstrap/js/autoload/15-jquery.uniform-modified.js](https://dev.suszek.info/themes/default-bootstrap/js/autoload/15-jquery.uniform-modified.js)\n\nThanks for any help."},"date":{"kind":"string","value":"2018/03/17"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/49336275","https://Stackoverflow.com","https://Stackoverflow.com/users/9368657/"],"string":"[\n \"https://Stackoverflow.com/questions/49336275\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/9368657/\"\n]"},"response":{"kind":"string","value":"If you want to get the same checkbox like with uniform you just need to invoke method bindUniform() after your button was handled. I assume that you get an answer after form handling with an ajax response, so you need to add \n\n`if (typeof bindUniform !=='undefined') {\n bindUniform();\n}`\n\nafter you get response and DOM was done."}}},{"rowIdx":35,"cells":{"qid":{"kind":"number","value":12023986,"string":"12,023,986"},"question":{"kind":"string","value":"Today I noticed that new MVC projects in VS 2012 are using [WebMatrix.WebData.WebSecurity](https://msdn.microsoft.com/en-us/library/webmatrix.webdata.websecurity%28v=vs.99%29.aspx) to handle membership related tasks.\n\nI went to msdn to a quick look at the documentation and was surprised. Lot's of good stuff in there and it will definitely save me a lot of time in future projects.\n\nBut one thing got my attention:\nIt doesn't have a function to \"Remove Accounts\". Is there a particular reason for that? Should I use the underlying membership provider to remove accounts (and other things such as unlock accounts)?"},"date":{"kind":"string","value":"2012/08/19"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/12023986","https://Stackoverflow.com","https://Stackoverflow.com/users/1061342/"],"string":"[\n \"https://Stackoverflow.com/questions/12023986\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/1061342/\"\n]"},"response":{"kind":"string","value":"Found the answer at MSDN:\n\n\n> \n> In ASP.NET Web Pages sites, you can access the functionality of the SimpleMembershipProvider class by using the Membership property of a web page. You do not (in fact, cannot) initialize a new instance of the SimpleMembershipProvider class...\n> \n> \n>"}}},{"rowIdx":36,"cells":{"qid":{"kind":"number","value":60655194,"string":"60,655,194"},"question":{"kind":"string","value":"everyone!\nI am trying to render the exchange rates from a server to my page.\nHere is my React code:\n\n```\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nclass App extends React.Component {\n constructor() {\n super();\n\n this.state = {\n exRates: []\n };\n }\n getCurrencyRatesFromDB = () => {\n fetch('https://api.exchangeratesapi.io/latest')\n .then((response) => {\n console.log('then 1', response);\n return response.json(); \n }).then((data) => {\n console.log('then 2', data);\n this.setState({\n exRates: data.rates\n });\n });\n }\n\n render() {\n console.log('render started');\n return (\n
\n console.log('return started'),\n \n

{this.state}

\n
\n )\n }\n}\n\nReactDOM.render(, document.getElementById('root'));\n\n```\n\nHow do I modify the 'render' part to see the rates in a column like it is on the server?\nThank very much to you in advance!"},"date":{"kind":"string","value":"2020/03/12"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/60655194","https://Stackoverflow.com","https://Stackoverflow.com/users/11894807/"],"string":"[\n \"https://Stackoverflow.com/questions/60655194\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/11894807/\"\n]"},"response":{"kind":"string","value":"1. You must not had an empty line beetween\n`@app.route(\"/profile/\")` and `def profile(name):`\n2. You have to set the html file in a folder called templates.\n3. You have to set the templates folder and run.py in the same folder"}}},{"rowIdx":37,"cells":{"qid":{"kind":"number","value":35285191,"string":"35,285,191"},"question":{"kind":"string","value":"I am executing a stored procedure but it is failing at some point, \nCurrent error code is not helping me to find where and exactly what the error is\nI wanted to know where it is exactly failing so wanted to print line by line output while executing. \nfor eg : \n\n```\n create or replace\n -- decaring required variable\n PROCEDURE \"PROC_DATA_TABLE_DETAILS\" IS\n FOR TABLEDETAILS IN (SELECT * FROM user_tables )\n LOOP\n\n dbms_output.put_line (TABLENAME);\n\n select NUM_ROWS INTO COUNTRECORDS from all_tables where owner not like 'SYS%'and TABLE_NAME = TABLEDETAILS.TABLE_NAME;\n\n FOR FIELDSDETAILS IN (SELECT * FROM USER_TAB_COLUMNS WHERE TABLE_NAME = TABLENAME)\n\n LOOP\n\nFIELDNAME :=FIELDSDETAILS.COLUMN_NAME;\n\n dbms_output.put_line (FIELDNAME );\n\n execute immediate 'SELECT NVL(count(*),0) FROM ' ||TABLENAME || ' WHERE '|| FIELDNAME || ' is not null ' into TEMPNONBLANK;\n END LOOP;\n\n INSERT INTO DATA_TABLE_DETAILS VALUES (TABLEDETAILS.TABLE_NAME,COUNTFIELDS)\n\n END LOOP;\n\n END PROC_DATA_TABLE_DETAILS;\n\n```"},"date":{"kind":"string","value":"2016/02/09"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/35285191","https://Stackoverflow.com","https://Stackoverflow.com/users/1767969/"],"string":"[\n \"https://Stackoverflow.com/questions/35285191\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/1767969/\"\n]"},"response":{"kind":"string","value":"Your code will look like this; additionally you can write a procedure with autonomous transactions to log all error or logs. you will also get online code for this functionality. \n\n[https://log4plsql.sourceforge.net/](https://logs)\n\n```\ncreate or replace procedure proc_data_table_details is\n tablename varchar2(30);\n countrecords number;\n fieldname varchar2(30);\n tempnonblank number;\nbegin\n for tabledetails in (select * from user_tables where rownum < 3) loop\n tablename := tabledetails.table_name;\n dbms_output.put_line(tabledetails.table_name);\n select num_rows\n into countrecords\n from all_tables\n where owner not like 'SYS%'\n and table_name = tablename;\n\n for fieldsdetails in (select * from user_tab_columns where table_name = tablename) loop\n fieldname := fieldsdetails.column_name;\n dbms_output.put_line(fieldname);\n execute immediate 'SELECT NVL(count(*),0) FROM ' || tablename || ' WHERE ' || fieldname || ' is not null '\n into tempnonblank;\n dbms_output.put_line('TABLENAME :' || tablename || ' column name :' || fieldname || ' count :' || tempnonblank);\n end loop;\n end loop;\nend proc_data_table_details;\n\n```"}}},{"rowIdx":38,"cells":{"qid":{"kind":"number","value":9094681,"string":"9,094,681"},"question":{"kind":"string","value":"I am having string like this\n\n```\nabcdedfd?xyz\nadcdefghdfd?red\n\n```\n\nso i wanted to remove the characters after the `?"},"date":{"kind":"string","value":"2012/02/01"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/9094681","https://Stackoverflow.com","https://Stackoverflow.com/users/551179/"],"string":"[\n \"https://Stackoverflow.com/questions/9094681\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/551179/\"\n]"},"response":{"kind":"string","value":"```\nNSString *newString = [[yourString componentsBySeparatedByString: @\"?\"] objectAtIndex: 0];\n\n```\n\nThis assuming the string you want to trim is in `NSString *yourString`."}}},{"rowIdx":39,"cells":{"qid":{"kind":"number","value":29908287,"string":"29,908,287"},"question":{"kind":"string","value":"I need help with my program. I declared a one-dimensional array of 6 and I want to show random values between 1-6 in a text box \n\nMy question is how do I show values in my array in textbox1.text?\n\nHere is my code:\n\n```\nPublic Sub ClickMyFirstClassButton()\n\n If FirstClass.Checked = True Then\n\n 'This piece of code declares an array\n Dim Seats As Integer()\n\n 'This is a One Dimensional Array\n ReDim Seats(6)\n\n TextBox1.Text = (String.Format(\"First Class is checked. The number of seats are : \", (Seats)))\n 'ElseIf FirstClass.AutoCheck = True Then\n\n 'MessageBox.Show(\"FirstClass is Auto checked\")\n End If\nEnd Sub \n\n```\n\nI messed around with my program and this is what I did.\n\nPublic Sub ClickMyFirstClassButton()\n\n```\n If FirstClass.Checked = True Then\n\n 'Dim Seats As Integer() = {1, 2, 3, 4, 5, 6}\n Dim Seats(0 To 6) As Integer\n Seats(0) = 1\n Seats(1) = 2\n Seats(2) = 3\n Seats(3) = 4\n Seats(4) = 5\n Seats(5) = 6\n\n TextBox1.Text = (String.Format(\"First Class is checked. Your seat is : {0}\", Seats(RandomNumber(Seats))))\n MessageBox.Show(String.Format(\"First Class is checked. Your seat is : {0}\", Seats(RandomNumber(Seats))))\n 'ElseIf FirstClass.AutoCheck Then\n\n 'MessageBox.Show(\"FirstClass is Auto checked\")\n\n End If\nEnd Sub\n\n```"},"date":{"kind":"string","value":"2015/04/28"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/29908287","https://Stackoverflow.com","https://Stackoverflow.com/users/4601982/"],"string":"[\n \"https://Stackoverflow.com/questions/29908287\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/4601982/\"\n]"},"response":{"kind":"string","value":"As suggested by @eryksun, this solves the issue:\n\n```\np = subprocess.Popen('clip.exe', stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True)\np.communicate('hello \\n world')\np.wait()\n\n```"}}},{"rowIdx":40,"cells":{"qid":{"kind":"number","value":11881490,"string":"11,881,490"},"question":{"kind":"string","value":"In a C# enumeration, are there any negative side effects of using a negative number?\n\nI am modelling response codes and one of the codes in negative. This compiles but I want to know if there are any negative side effects to this.\n\n```\npublic enum ResponseCodes\n{\n InvalidServerUserPasswordCombo = -1,\n\n // etc.\n}\n\n```"},"date":{"kind":"string","value":"2012/08/09"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/11881490","https://Stackoverflow.com","https://Stackoverflow.com/users/64226/"],"string":"[\n \"https://Stackoverflow.com/questions/11881490\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/64226/\"\n]"},"response":{"kind":"string","value":"> \n> negative side effects of using a negative number\n> \n> \n> \n\nClearly, with any underlying signed type, any bitwise operations are going to get \"interesting\" very quickly.\n\nBut using an enum as a collection of related constants can quite happily use negative values."}}},{"rowIdx":41,"cells":{"qid":{"kind":"number","value":261384,"string":"261,384"},"question":{"kind":"string","value":"I am trying to install additional drivers on Ubuntu 12.04. The application is returning an error. In the log file I can see various NVIDIA module failed to load. However, my PC do not have NVIDIA graphics card. Its Intel card, then why is Ubuntu searching for NVIDIA card?\n\nI have installed Ubuntu 12.04 and additional drivers before without any error.\n\nThough this is the first time I am using Windows installer version. I don't know if its related to that."},"date":{"kind":"string","value":"2013/02/26"},"metadata":{"kind":"list like","value":["https://askubuntu.com/questions/261384","https://askubuntu.com","https://askubuntu.com/users/135680/"],"string":"[\n \"https://askubuntu.com/questions/261384\",\n \"https://askubuntu.com\",\n \"https://askubuntu.com/users/135680/\"\n]"},"response":{"kind":"string","value":"**Yes**, but you will need Ubuntu 12.10.\n\n1. Download Steam from Ubuntu Software Center\n2. Start it up, you will be asked to log in with your Steam account. If you don't have one you can choose the create account option.\n3. Go to the Store tab\n4. Enter Don't Starve in the search bar in the top-right and click Don't Starve\n5. Scroll a bit down and click the green button to buy the game\n6. Pay with credit card or PayPal. It costs €14\n7. The game will be downloaded and installed\n8. **Play :-D**"}}},{"rowIdx":42,"cells":{"qid":{"kind":"number","value":3195720,"string":"3,195,720"},"question":{"kind":"string","value":"I know the question has been asked thousands of times, but I'll ask it again: is there a way (even patchy) to write/read a dumb text file with Javascript or Protoype ?\n\nThis is only for debug purposes, and is not designed for production. The thing is I need it to work with (at least) both Firefox and IE (preferably under Windows).\n\nThanks in advance !"},"date":{"kind":"string","value":"2010/07/07"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/3195720","https://Stackoverflow.com","https://Stackoverflow.com/users/277128/"],"string":"[\n \"https://Stackoverflow.com/questions/3195720\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/277128/\"\n]"},"response":{"kind":"string","value":"Writing to a file is not possible, you'd have to write a server-side script and make a request to that script. Reading is possible if you use an iframe with the text file's location as source, and reading the iframe contents."}}},{"rowIdx":43,"cells":{"qid":{"kind":"number","value":945527,"string":"945,527"},"question":{"kind":"string","value":"Isn't that nicely recursive? \n\nI've got a portable command prompt on my external drive, and it has a nice .bat file to configure some initial settings, but I'd like more! \n\nHere's what I know how to set from .bat:\n\n* Colors = (color XY) where x and y are hex digits for the predefined colors\n* Prompt = (prompt $p$g) sets the prompt to \"C:\\etc\\etc >\" the default prompt\n* Title = (title \"text\") sets the window title to \"text\"\n* Screen Size = (mode con: cols=XX lines=YY) sets the columns and lines size of the window\n* Path = (SET PATH=%~d0\\bin;%PATH%) sets up local path to my tools and appends the computer's path\n\nSo that's all great. But there are a few settings I can't seem to set from the bat. Like, how would I set these up wihtout using the Properties dialogue:\n\n* Buffer = not screen size, but the buffer\n* Options like quick edit mode and autocomplete\n* Popup colors\n* Font. And can you use a font on the portable drive, or must it be installed to work?\n* Command history options"},"date":{"kind":"string","value":"2009/06/03"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/945527","https://Stackoverflow.com","https://Stackoverflow.com/users/93221/"],"string":"[\n \"https://Stackoverflow.com/questions/945527\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/93221/\"\n]"},"response":{"kind":"string","value":"Regarding setting the buffer size:\n\nUsing `mode con: cols=XX lines=YY` sets not only the window (screen) size, but the buffer size too.\n\nIf you specify a size allowed by your system, based on available screen size, you'll see that both window and buffer dimension are set to the same value; .e.g:\n\n```\nmode con: cols=100 lines=30\n\n```\n\nresults in the following (values are the same):\n\n* window size: Width=**160**, Height=**78**\n* buffer size: Width=**160**, Height=**78**\n\nBy contrast, if you specify values that are too large based on the available screen size, you'll see that the window size changes to its maximum, but the buffer size is changed to the values as specified.\n\n```\nmode con: cols=1600 lines=900\n\n```\n\nWith a screen resolution of 1280x1024, you'll get:\n\n* window size: Width=**160**, Height=**78**\n* buffer size: Width=**1600**, Height=**900**"}}},{"rowIdx":44,"cells":{"qid":{"kind":"number","value":53386051,"string":"53,386,051"},"question":{"kind":"string","value":"I would like to append a 256 digits to thousands of number in notepad plus to appear as below:\n\n```\n776333533\n774361221\n772333707\n771615215\n784713890\n786164089\n777664662\n\n```\n\nI would want all these numbers to appear as below:\n\n```\n256776333533\n256774361221\n256772333707\n256771615215\n256784713890\n256786164089\n256777664662\n\n```\n\ni need a command that can enable me achieve this"},"date":{"kind":"string","value":"2018/11/20"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/53386051","https://Stackoverflow.com","https://Stackoverflow.com/users/10626686/"],"string":"[\n \"https://Stackoverflow.com/questions/53386051\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/10626686/\"\n]"},"response":{"kind":"string","value":"Here below is I think a good example of your requirement. Modules will be loaded with page properties. As page property is depended on iron-page, `selected='{{page}}'` when page value has been changed with iron-page's name properties, its observer loads the that page's modules. : \n\n```\nstatic get properties() { return {\n page: {\n type: String,\n reflectToAttribute: true,\n observer: '_pageChanged'\n },\n.......\n\n_pageChanged(page, oldPage) {\n if (page != null) {\n let cb = this._pageLoaded.bind(this, Boolean(oldPage));\n\n // HERE BELOW YOUR PAGE NAMES\n switch (page) {\n case 'list':\n import('./shop-list.js').then(cb);\n break;\n case 'detail':\n import('./shop-detail.js').then(cb);\n break;\n case 'cart':\n import('./shop-cart.js').then(cb);\n break;\n case 'checkout':\n import('./shop-checkout.js').then(cb);\n break;\n default:\n this._pageLoaded(Boolean(oldPage));\n }\n\n```\n\nhere above `cb` is a function which is loading lazy modules but needs to load immediately after the first render. Which is minimum required files. \n\n```\n_pageLoaded(shouldResetLayout) {\n this._ensureLazyLoaded();\n\n}\n\n```\n\nHere the full code's link of the above. Hope this helps In case of any question I will try to reply. "}}},{"rowIdx":45,"cells":{"qid":{"kind":"number","value":223590,"string":"223,590"},"question":{"kind":"string","value":"Where does this meme come from (as in a *trip down memory lane*) ?\n\nIs it from a book ?"},"date":{"kind":"string","value":"2015/01/25"},"metadata":{"kind":"list like","value":["https://english.stackexchange.com/questions/223590","https://english.stackexchange.com","https://english.stackexchange.com/users/64820/"],"string":"[\n \"https://english.stackexchange.com/questions/223590\",\n \"https://english.stackexchange.com\",\n \"https://english.stackexchange.com/users/64820/\"\n]"},"response":{"kind":"string","value":"Christine Ammer, *The Facts on File Dictionary of Clichés*, second edition (2006) has this entry for the phrase \"down memory lane\":\n\n> \n> **down memory lane** Looking back on the past. Often put in a nostalgic way, this term may have originated as the title of a popular song of 1924, \"Memory Lane,\" words by Bud de Sylva, and music by Larry Spier and Con Conrad. It was revived in the film *In Society* (1944), starring [Bud] Abbott and [Lou] Costello. That is where former movie actor President Ronald Reagan may have picked it up; he then used it in his 1984 speech accepting the Republican nomination, \"Well, let's take them [his opponents] on a little stroll down memory lane.\"\n> \n> \n> \n\nAmmer's chronology notwithstanding, \"memory lane\" was a familiar turn of phrase back in 1972, when Loudon Wainright III turned it on itself in his 1972 song \"Old Friend,\" from his third album:\n\n> \n> It's been so long, things are so different.\n> \n> \n> Memory lane's a one-way street.\n> \n> \n> \n\nAlthough Ammer may be correct that \"memory lane\" owes its first surge of popularity to a song from 1924, the phrase was certainly used before that time. A Google Books search finds this instance from B. M. Balch, \"[Memory Lane](https://books.google.com/books?id=syATAAAAIAAJ&pg=RA1-PA101&dq=%22memory+lane%22&hl=en&sa=X&ei=7cvEVOf9KsT6oQS0xIHgCw&ved=0CCIQ6AEwAQ#v=onepage&q=%22memory%20lane%22&f=false),\" in *Hamilton Literary Magazine* (December 1894):\n\n> \n> On the shore of vast gray sea lies an old town; so old that no records of its founding have ever been discovered, though its archives cover centuries of existence. Every wall is crumbling away. Every gable is lichen-grown and covered with moss. In the whole great city there is nothing new. Thro the centre of the town a quaint old street, paved with square blocks of various hues from a somber gray to a bright crimson, runs down to the sea. This is Memory Lane—lonely and drear to some, pleasant and gay to others.\n> \n> \n> \n\nOlder still is this instance of \"memory's lane,\" from William Bowen, \"[That Frozen Pipe](https://books.google.com/books?id=WpcVAAAAYAAJ&pg=PA79&dq=%22down+memory+lane%22&hl=en&sa=X&ei=BtDEVNiZKYj7yASty4GgBA&ved=0CBwQ6AEwADge#v=onepage&q=%22down%20memory%20lane%22&f=false),\" in *Chained Lightning, a Book of Fun* (1883):\n\n> \n> When you have come as near as may be to the frozen spot, hold the flat-iron on the pipe and settle down for ten minutes of meditation. You won't have traveled down memory's lane over half a mile before something will happen. The pipe will burst exactly on a line with your eyes, and you will have cause to wonder all the rest of your life how a gallon of water could have collected at that one point for your benefit.\n> \n> \n> \n\nA search of the Library of Congress's Chronicling America database of U.S. newspapers finds the same \"That Frozen Pipe\" story in the [*[Rayville, Louisiana] Richland Beacon*](https://chroniclingamerica.loc.gov/lccn/sn86079088/1881-04-23/ed-1/seq-4/#date1=1836&index=0&rows=20&words=down+lane+memory+traveled&searchType=basic&sequence=0&state=&date2=1882&proxtext=%22traveled+down+memory%27s+lane%22&y=12&x=16&dateFilterType=yearRange&page=1) (April 23, 1881), which gives its source as the *Detroit Free Press* (undated). I couldn't find the *Detroit Free Press* version of the story in the Library of Congress database.\n\nAlso of possible interest, another song called \"[Memory Lane](https://books.google.com/books?id=ff43AQAAMAAJ&pg=PA585&dq=%22memory+lane%22&hl=en&sa=X&ei=kc7EVJTuJomqogSbpIHgDw&ved=0CDkQ6AEwBjhk#v=onepage&q=%22memory%20lane%22&f=false)\"—this one by R.H. Elkin and A. L. Liebmann—was catalogued in London on January 19, 1903.\n\n---\n\nAlmost certainly unrelated, but an amusing coincidence, is this item from the [*[Washington, D.C.] Evening Star*](https://chroniclingamerica.loc.gov/lccn/sn83045462/1879-01-06/ed-1/seq-3/#date1=1836&index=5&rows=20&words=Lane+memory+recitation&searchType=basic&sequence=0&state=&date2=1922&proxtext=memory.+Lane%27s+recitation&y=10&x=15&dateFilterType=yearRange&page=1) (January 6, 1879):\n\n> \n> A story of a wonderful memory comes from Sydney, Australia. A prisoner set up in his defense an alibi, claiming that, at the time of the robbery, he was at home listening to the recital of a novel, \"The Old Baron,\" by a man named Lane, who had committed it, with other works, to memory. Lane's recitation, he said, took two hours and a half. The Attorney General holding this to be incredible, Lane began: ... After the witness had recited several pages, the Attorney General told him to stop, as he was satisfied. But the defense insisted that, as the veracity of the witness had been questioned, he should be allowed to go on. Finally a compromise was effected, Lane gave a chapter from the middle of the story and its conclusion, and the accused was found not guilty.\n> \n> \n> \n\nThe story reappeared in newspapers from Louisiana, Michigan, Minnesota, North Carolina, Ohio, Pennsylvania, Tennessee, and Washington Territory over the next five months. It also appeared, in a slightly more detailed form, in [*Frank Leslie's Illustrated Newspaper*](https://books.google.com/books?id=ZUJaAAAAYAAJ&pg=PA365&dq=%22Lane%27s+recitation%22&hl=en&sa=X&ei=AKPGVNvbIMm6ogSxyICQCw&ved=0CCQQ6AEwAQ#v=onepage&q=%22Lane%27s%20recitation%22&f=false) (January 18, 1879), with such additional details as the name of the author of *The Old Baron* (Horace Walpole) and the fact that the episode occurred in January 1847.\n\nWas \"memory lane\" influenced by the stir made in 1879 by the account of the remarkable memory of Mr. Lane of Sydney, Australia? I don't think so, but it makes a good apocryphal story."}}},{"rowIdx":46,"cells":{"qid":{"kind":"number","value":41983979,"string":"41,983,979"},"question":{"kind":"string","value":"Configuring multiple sources for an agent throwing me lock error using FILE channel. Below is my config file.\n\n```\na1.sources = r1 r2\na1.sinks = k1 k2\na1.channels = c1 c3\n\n#sources\na1.sources.r1.type=netcat\na1.sources.r1.bind=localhost\na1.sources.r1.port=4444\n\na1.sources.r2.type=exec\na1.sources.r2.command=tail -f /opt/gen_logs/logs/access.log\n\n#sinks\na1.sinks.k1.type=hdfs\na1.sinks.k1.hdfs.path=/flume201\na1.sinks.k1.hdfs.filePrefix=netcat-\na1.sinks.k1.rollInterval=100\na1.sinks.k1.hdfs.fileType=DataStream\na1.sinks.k1.hdfs.callTimeout=100000\n\na1.sinks.k2.type=hdfs\na1.sinks.k2.hdfs.path=/flume202\na1.sinks.k2.hdfs.filePefix=execCommand-\na1.sinks.k2.rollInterval=100\na1.sinks.k2.hdfs.fileType=DataStream\na1.sinks.k2.hdfs.callTimeOut=100000\n\n#channels\na1.channels.c1.type=file\na1.channels.c1.checkpointDir=/home/cloudera/alpha/001\na1.channels.c3.type=file\na1.channels.c3.checkpointDir=/home/cloudera/beta/001\n\n#bind r1 c1 k1\na1.sources.r1.channels=c1\na1.sinks.k1.channel=c1\n\na1.sources.r2.channels=c3\na1.sinks.k2.channel=c3\n\n```\n\nI am getting below error\n\n```\nChannel closed [channel=c3]. Due to java.io.IOException: Cannot lock /home/cloudera/.flume/file-channel/data. The directory is already locked. [channel=c3]\n\n```\n\nBut when i am using memory channel. Its working fine."},"date":{"kind":"string","value":"2017/02/01"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/41983979","https://Stackoverflow.com","https://Stackoverflow.com/users/4029265/"],"string":"[\n \"https://Stackoverflow.com/questions/41983979\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/4029265/\"\n]"},"response":{"kind":"string","value":"Check your php.ini for:\n\n**session.gc\\_maxlifetime** - Default 1440 secs - 24 mins\n\n> \n> **session.gc\\_maxlifetime** specifies the number of seconds after which data will be seen as 'garbage' and potentially cleaned up. Garbage collection may occur during session start (depending on session.gc\\_probability and session.gc\\_divisor).\n> \n> \n> \n\n**session.cookie\\_lifetime** - Default 0\n>**session.cookie\\_lifetime** specifies the lifetime of the cookie in seconds which is sent to the browser. The value 0 means \"until the browser is closed.\" Defaults to 0. See also session\\_get\\_cookie\\_params() and session\\_set\\_cookie\\_params().\n\nIn case it is less time than the Laravel configuration, the cookie will be removed because the local php.ini have **preference** over Laravel configuration.\n\nYou can just increase it or comment/delete.\n\nIn case is not solved something on your App is destroying the session.\n\n**UPDATE**\n\nAfter release [v5.5.22](https://github.com/laravel/laravel/releases/tag/v5.5.22) session lifetime is loaded from `.env` and is not hardcoded anymore at `config/session.php`, changes [there](https://github.com/laravel/laravel/commit/084f10004582299ef3897f6ec14315209d5c1df1#diff-cbfd64a28982a1818f2b5f16e7f9d634).\n\nNow you can modify the session lifetime using:\n\n```\nSESSION_LIFETIME=90 //minutes\n\n```\n\nIn your `.env` file."}}},{"rowIdx":47,"cells":{"qid":{"kind":"number","value":22153836,"string":"22,153,836"},"question":{"kind":"string","value":"I am curious as to why Start-Job increments in twos. My worry is that I am doing something wrong that makes the ID of a new job jump by 2.\n\n```\nStart-Job -ScriptBlock {Get-WinEvent -LogName system -MaxEvents 1000} \n\n```\n\nResults as shown by Get-Job\n\n```\nId Name State HasMoreData Command \n-- ---- ----- ----------- ------- \n 2 Job2 Completed False Get-WinEvent -LogName system -MaxEvents 1000 \n 4 Job4 Completed False Get-WinEvent -LogName system -MaxEvents 1000 \n 6 Job6 Completed True Get-WinEvent -LogName system -MaxEvents 1000 \n\n```\n\nQuestion: Can you control the Start-Job Id increments, or force them to be just 1?"},"date":{"kind":"string","value":"2014/03/03"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/22153836","https://Stackoverflow.com","https://Stackoverflow.com/users/200586/"],"string":"[\n \"https://Stackoverflow.com/questions/22153836\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/200586/\"\n]"},"response":{"kind":"string","value":"Each time you start a job, it consists of a parent job and one or more child jobs. If you run `get-job | fl` you'll see the child jobs, and you'll see that their names are the \"missing\" odd numbered names."}}},{"rowIdx":48,"cells":{"qid":{"kind":"number","value":4554498,"string":"4,554,498"},"question":{"kind":"string","value":"I am creating a Chart (DataVisualization.Charting.Chart) programmatically, which is a Stacked Bar chart.\n\nI am also adding Legend entries programmatically to it. I want to show the Legend at the bottom of the chart.\n\nBut, while doing so, the Legend overlapps with the X-axis of the chart.\n\nHere is the code I am using:\n\n```\nPrivate Function GetLegend(ByVal legendName As String, ByVal s As Single) As System.Windows.Forms.DataVisualization.Charting.Legend\n\n Dim objLegend As System.Windows.Forms.DataVisualization.Charting.Legend = New System.Windows.Forms.DataVisualization.Charting.Legend()\n\n objLegend.Name = legendName\n objLegend.Font = New System.Drawing.Font(\"Verdana\", s)\n objLegend.IsDockedInsideChartArea = False\n objLegend.Docking = Docking.Bottom\n Return objLegend\nEnd Function\n\n```\n\nBelow statement adds that Legend to the chart\n\n```\n_msChart.Legends.Add(GetLegend(\"SomeValue1\", 10.0F))\n\n```\n\nAny idea, what is missing? I want to show the legend at the bottom only, but it should not overlapp with the X-axis."},"date":{"kind":"string","value":"2010/12/29"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/4554498","https://Stackoverflow.com","https://Stackoverflow.com/users/557172/"],"string":"[\n \"https://Stackoverflow.com/questions/4554498\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/557172/\"\n]"},"response":{"kind":"string","value":"I had the same problem today. Try adding:\n\n```\nobjLegend.Position.Auto = true\nobjLegend.DockedToChartArea = \"yourChartAreaName\"\n\n```\n\nThat did not help me but I found on the net that this might be helpful (and clean solution).\n\nWhat actually worked for me was moving chart area to make space for legend so it no longer overlaps. My legend was on top so this code worked for me:\n\n```\nchart.ChartAreas[0].Position.Y = 15\n\n```\n\nYou can try resizing it instead, forcing it to be for example 20 pixels shorter than `chart.Size`.\n\nHope this helps."}}},{"rowIdx":49,"cells":{"qid":{"kind":"number","value":68722703,"string":"68,722,703"},"question":{"kind":"string","value":"I understand this is usually a pointer error. However, I can't seem to solve it here is what I have tried:\n\n* Repair visual studio\n* Repair .NET core\n* Reinstall visual studio\n* Reinstall .NET core\n* Clean and rebuild the solution\n\nAfter doing all of these I am still getting the same error. Does anyone have any more ideas on how I could solve this issue? In case it is needed it is being triggered on line 79 of Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets which is the following code block\n\n```\n \n \n\n\n```"},"date":{"kind":"string","value":"2021/08/10"},"metadata":{"kind":"list like","value":["https://Stackoverflow.com/questions/68722703","https://Stackoverflow.com","https://Stackoverflow.com/users/4990927/"],"string":"[\n \"https://Stackoverflow.com/questions/68722703\",\n \"https://Stackoverflow.com\",\n \"https://Stackoverflow.com/users/4990927/\"\n]"},"response":{"kind":"string","value":"I managed to solve this by having to install an older depreciated version of .NET alongside the version of .NET being used for the project with the older version that was required to be installed being version [2.0.9](https://dotnet.microsoft.com/download/dotnet/2.0/runtime?utm_source=getdotnetcore&utm_medium=referral)"}}},{"rowIdx":50,"cells":{"qid":{"kind":"number","value":15759186,"string":"15,759,186"},"question":{"kind":"string","value":"Ok this is my JavaScript\n\n```\n