Id
int64
34.6M
60.5M
Title
stringlengths
15
150
Body
stringlengths
33
36.7k
Tags
stringlengths
3
112
CreationDate
stringdate
2016-01-01 00:21:59
2020-02-29 17:55:56
Y
stringclasses
3 values
56,262,655
Flutter: Get passed arguments from Navigator in Widget's state's initState
<p>I have a <code>StatefulWidget</code> which I want to use in named route. I have to pass some arguments which I am doing as suggested in <a href="https://flutter.dev/docs/cookbook/navigation/navigate-with-arguments" rel="noreferrer">https://flutter.dev/docs/cookbook/navigation/navigate-with-arguments</a> i.e.</p> <pre><code>Navigator.pushNamed( context, routeName, arguments: &lt;args&gt;, ); </code></pre> <p>Now, I need to access these argument's in the state's <code>initState</code> method as the arguments are needed to subscribe to some external events. If I put the <code>args = ModalRoute.of(context).settings.arguments;</code> call in <code>initState</code>, I get a runtime exception.</p> <pre><code>20:49:44.129 4 info flutter.tools I/flutter ( 2680): ══║ EXCEPTION CAUGHT BY WIDGETS LIBRARY β•žβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• 20:49:44.129 5 info flutter.tools I/flutter ( 2680): The following assertion was thrown building Builder: 20:49:44.129 6 info flutter.tools I/flutter ( 2680): inheritFromWidgetOfExactType(_ModalScopeStatus) or inheritFromElement() was called before 20:49:44.130 7 info flutter.tools I/flutter ( 2680): _CourseCohortScreenState.initState() completed. 20:49:44.130 8 info flutter.tools I/flutter ( 2680): When an inherited widget changes, for example if the value of Theme.of() changes, its dependent 20:49:44.131 9 info flutter.tools I/flutter ( 2680): widgets are rebuilt. If the dependent widget's reference to the inherited widget is in a constructor 20:49:44.131 10 info flutter.tools I/flutter ( 2680): or an initState() method, then the rebuilt dependent widget will not reflect the changes in the 20:49:44.131 11 info flutter.tools I/flutter ( 2680): inherited widget. 20:49:44.138 12 info flutter.tools I/flutter ( 2680): Typically references to inherited widgets should occur in widget build() methods. Alternatively, 20:49:44.138 13 info flutter.tools I/flutter ( 2680): initialization based on inherited widgets can be placed in the didChangeDependencies method, which 20:49:44.138 14 info flutter.tools I/flutter ( 2680): is called after initState and whenever the dependencies change thereafter. 20:49:44.138 15 info flutter.tools I/flutter ( 2680): 20:49:44.138 16 info flutter.tools I/flutter ( 2680): When the exception was thrown, this was the stack: 20:49:44.147 17 info flutter.tools I/flutter ( 2680): #0 StatefulElement.inheritFromElement.&lt;anonymous closure&gt; (package:flutter/src/widgets/framework.dart:3936:9) 20:49:44.147 18 info flutter.tools I/flutter ( 2680): #1 StatefulElement.inheritFromElement (package:flutter/src/widgets/framework.dart:3969:6) 20:49:44.147 19 info flutter.tools I/flutter ( 2680): #2 Element.inheritFromWidgetOfExactType (package:flutter/src/widgets/framework.dart:3285:14) 20:49:44.147 20 info flutter.tools I/flutter ( 2680): #3 ModalRoute.of (package:flutter/src/widgets/routes.dart:698:46) 20:49:44.147 21 info flutter.tools I/flutter ( 2680): #4 _CourseCohortScreenState.initState.&lt;anonymous closure&gt; (package:esk2/cohort_screen.dart:57:23) </code></pre> <p>I do not want to put that logic in <code>build</code> method as <code>build</code> could be called multiple times and the initialization needs to happen only once. I could put the entire logic in a block with a boolean isInitialized flag, but that does not seem like the right way of doing this. Is this requirement/case not supported in flutter as of now?</p>
<flutter>
2019-05-22 18:10:24
HQ
56,263,196
Why when spinning object I need to set the speed value to 2000 to make it spin fast?
I want it to spin at speed from 0 to very fast. But if I'm changing the value of the spin to 10 it's almost not moving and 200 make it move slowly. 2000 make it move fast. But why only when changing to 2000 it's spinning fast ? public float rotationSpeed; private void Update() { scaling.objectToScale.transform.Rotate(Vector3.up, rotationSpeed * Time.deltaTime); }
<c#><unity3d>
2019-05-22 18:50:10
LQ_EDIT
56,263,200
How to define string literal union type from constants in Typescript
<p>I know I can define string union types to restrict variables to one of the possible string values:</p> <pre><code>type MyType = 'first' | 'second' let myVar:MyType = 'first' </code></pre> <p>I need to construct a type like that from constant strings, e.g:</p> <pre><code>const MY_CONSTANT = 'MY_CONSTANT' const SOMETHING_ELSE = 'SOMETHING_ELSE' type MyType = MY_CONSTANT | SOMETHING_ELSE </code></pre> <p>But for some reason it doesn't work; it says <code>MY_CONSTANT refers to a value, but it being used as a type here</code>.</p> <p>Why does Typescript allow the first example, but doesn't allow the second case? I'm on Typescript 3.4.5</p>
<typescript><string-literals><typescript3.0><union-types>
2019-05-22 18:50:21
HQ
56,266,511
I can't install a Pythone module via pip3
I need to install the module 'Request' but when I run the command pip3 install Request it gives me back this error: This is what I need to run the program: from urllib.request import Request, urlopen from bs4 import BeautifulSoup from fake_useragent import UserAgent import random and this is what I get when I try to install Request module via pip3 in terminal: Collecting Request Installing collected packages: Request ERROR: Exception: Traceback (most recent call last): File "/root/.local/lib/python3.5/site-packages/pip/_internal/cli/base_command.py", line 178, in main status = self.run(options, args) File "/root/.local/lib/python3.5/site-packages/pip/_internal/commands/install.py", line 414, in run use_user_site=options.use_user_site, File "/root/.local/lib/python3.5/site-packages/pip/_internal/req/__init__.py", line 58, in install_given_reqs **kwargs File "/root/.local/lib/python3.5/site-packages/pip/_internal/req/req_install.py", line 920, in install use_user_site=use_user_site, pycompile=pycompile, File "/root/.local/lib/python3.5/site-packages/pip/_internal/req/req_install.py", line 448, in move_wheel_files warn_script_location=warn_script_location, File "/root/.local/lib/python3.5/site-packages/pip/_internal/wheel.py", line 428, in move_wheel_files assert info_dir, "%s .dist-info directory not found" % req AssertionError: Request .dist-info directory not found While if I run pip install Request it tells me that requirements are already satisfied, but when I run the program it says that module Request is missing.
<python><python-3.x><pip>
2019-05-23 00:11:28
LQ_EDIT
56,267,965
Array from preg_match_all
The code what working: $url = 'http://www.google.com/search?hl=en&tbo=d&site=&source=hp&q=upoznavanje'; $html = file_get_html($url); preg_match_all('/(?<="><cite>).*?(?=<\/cite><div\ class=)/', $html, $output); foreach ($output[0] as $link) { $link ."<br>" ; } But when i put echo $output[0] i get 0, or $output[1] nothing var_dump works and print_r array is there, but how to take unique value of each - but not with foreach ?
<php><preg-match-all>
2019-05-23 04:09:24
LQ_EDIT
56,269,792
My simple webview application is suspended on googleplayconsole now how can i publish again or remove it.?
<p>before yesterday i uploaded my application and yesterday i get this response</p> <blockquote> <p>An email with details about the removal has been sent to the account owner at myEmail@gmail.com. Before uploading any new applications, please review the Developer Distribution Agreement and Developer Program Policies. If you feel we have made this determination in error, you can visit this Google Play Help Center article to learn how you can appeal against the removal.</p> </blockquote> <p>and solve this errors and now again upload application and now i get this error.</p> <blockquote> <p>You need to use a different package name because "com.app.my_appliaction_name" is already used by one of your other applications.</p> </blockquote>
<java><android><google-play-console>
2019-05-23 07:07:36
LQ_CLOSE
56,272,046
php mysql query returns empty set, but phpmyadmin returns result
I have set up a query as such: $query = 'SELECT SGC.sys_id, TBL.semester, SGC.bonus, SGC.exam, SGC.ca FROM SubjectGradeComponent AS SGC, '; $query .= '(SELECT `sys_id`, `semester` FROM AcademicYearTerm AS AYT, SubjectYearTermLevel AS SYTL WHERE academic_year = "' . $academic_year . '" AND SYTL.subject_id = ' . $subject_id . ' AND SYTL.form_level = ' . $form_level. ' AND SYTL.yearTerm_id = AYT.yearTerm_id) AS TBL '; $query .= 'WHERE SGC.sys_id = TBL.sys_id;'; However when I run the query, `$mysql->query($query);`it returns an empty result with 0 rows. Running the same query on phpmyadmin shows the desired result. I have looked around but do not understand the problem. `$mysql->error` does not show any error message either
<php><mysql>
2019-05-23 09:24:05
LQ_EDIT
56,277,058
Handle multiple events in gpio
<p>I'm new to embedded programming and I apologise in advance for any confusion.</p> <p>I need to handle multiple events from different devices connected to a gpio. These events need to be monitored continually. This means that after one event is generated and handled, the code needs to keep monitoring the device for other events.</p> <p>I understand the concept of interruptions and polling in Linux (the kernel gets an interruption and dispatch it to the handler which goes on up to the callee of an epoll which is inside an infinite loop while(1)-like). </p> <p>This is fine for one-time, single-event toy models. In a embedded system with limited resources such as the <a href="https://www.digikey.com/eewiki/display/linuxonarm/AT91SAM9x5#AT91SAM9x5-LinuxKernel" rel="nofollow noreferrer">AT91SAM9x5</a> that runs at 400mhz and has 128mb of ram what can I do ? I believe that the while(1)-like pattern isn't the best choice. I've heard good things about thread pool solution but at the heart of each thread don't we find a while(1) ? </p> <p>What are my options to attack this problem ?</p> <p>Thank you in advance !</p>
<c++><linux><embedded><gpio>
2019-05-23 14:05:54
LQ_CLOSE
56,277,278
IE 11 does not support method β€˜from’
<p>My 3000 lines of code execute just fine in chrome and Firefox with zero errors reported.</p> <p>However, in IE11 (where the code MUST run), I get an error saying that the method β€˜from’ is not supported at the following line:</p> <pre><code>var inputsArray = Array.from(document.querySelectorAll('input.input' + b)); </code></pre> <p>How can I resolve this?</p> <p>The HTML file contains the correct compatibility mode for edge so that’s not the issue.</p>
<javascript><internet-explorer-11>
2019-05-23 14:18:21
LQ_CLOSE
56,278,371
GCC 9.1 returns void& as result type for an explicit destructor call. Is this a bug?
<p>I'm trying to get <a href="https://stackoverflow.com/a/10722840/4694124">this is-class-defined-check</a> to work, which relies on the fact that <code>decltype(std::declval&lt;Foo&gt;().~Foo())</code> is <code>void</code> if <code>Foo</code> has a destructor (which it has if it is defined…) and is ill-formed otherwise, invoking SFINAE in this case.</p> <p>However, I can't get the code to work with GCC 9.1, and that is because GCC 9.1 seems to consider that type to be <code>void &amp;</code> <em>if the destructor is defaulted</em>, consider this example:</p> <pre><code>#include &lt;type_traits&gt; class Foo { public: // With this, the DestructorReturnType below becomes "void" // ~Foo () {} }; // … unless I specify the user-defined destructor above, in which case it is "void" using DestructorReturnType = decltype(std::declval&lt;Foo&gt;().~Foo()); template&lt;class T&gt; class TD; // Says: aggregate 'TD&lt;void&amp;&gt; t' has incomplete type and cannot be defined TD&lt;DestructorReturnType&gt; t; </code></pre> <p>(available at <a href="https://gcc.godbolt.org/z/K1TjOP" rel="noreferrer">https://gcc.godbolt.org/z/K1TjOP</a> ) </p> <p>If I user-define an empty destructor, the type jumps back to <code>void</code>. Also if I switch back to GCC 8.x.</p> <p>The C++17 standard states in [expr.call]:</p> <blockquote> <p>If the postfix-expression designates a destructor, the type of the function call expression is void; […]</p> </blockquote> <p>Because of all this, I suspect that GCC 8.x (and clang, …) are correct, and GCC 9.1 is just wrong. Or am I missing something?</p>
<c++><gcc><language-lawyer><c++17>
2019-05-23 15:18:08
HQ
56,279,290
Problem Checking Username in CS50 Finance
<p>For some reason, the check route does not return false when the username is unavailable. Does anyone have an idea of what I am doing wrong?</p> <p>I have tried various different notations for the javascript code, but I have not altered the check code because it seems correct to me.</p> <p>Here is the python code:</p> <pre><code>@app.route("/check", methods=["GET"]) def check(): # Return true if username available, else false, in JSON format username = request.form.get("username") taken_usernames = db.execute("SELECT username FROM users") if not len(str(username)) &gt; 0: return jsonify(False) for taken_username in taken_usernames: if username == taken_username["username"]: return jsonify(False) return jsonify(True) </code></pre> <p>Here is the html code using the above route:</p> <pre><code>{% extends "layout.html" %} {% block title %} Register {% endblock %} {% block main %} &lt;form action="/register" method="post" onsubmit="function(event) { event.preventDefault(); }"&gt; &lt;div class="form-group"&gt; &lt;input autocomplete="off" autofocus class="form-control" name="username" placeholder="Username" type="text"&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;input class="form-control" name="password" placeholder="Password" type="password"&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;input class="form-control" name="confirmation" placeholder="Confirm Password" type="password"&gt; &lt;/div&gt; &lt;button class="btn btn-primary" type="submit"&gt;Register&lt;/button&gt; &lt;/form&gt; {% endblock %} {% if get_flashed_messages() %} &lt;script&gt; var username = document.querySelector('input.username'); var register = document.querySelector('form'); register.onsubmit = function(success) { $.get('/check?username=' + username, function() { if (success == false) { document.getElement('form').addEventListener("submit", function(event){ event.preventDefault(); }); alert('Username already taken'); } else { register.submit(); } }); }; &lt;/script&gt; {% endif %} </code></pre> <p>The route is supposed to return "false" when the username is unavailable, but it returns "true".</p>
<javascript><python><flask>
2019-05-23 16:14:52
LQ_CLOSE
56,279,389
What does @ > the rate symbol does in SQL
Hi i have code that does that uses @> in select statement. I need to change the query from redash counterpart to bigquery. I have searched about the @ that mean the argument will be taken after in order to prevent it from the sql injection. ``` select u.user_kvs IS NOT NULL AND u.user_kvs @> 'google_authenticator_enabled=>1' from sometable ``` not sure what it does thats the question.
<sql><google-bigquery><redash>
2019-05-23 16:22:06
LQ_EDIT
56,279,671
What happend when we override union fields in C?
I am reading the implementation of Thompson algorithm for matching regular expression in C. [link][1]. I saw this snippet of code ```C /* * Since the out pointers in the list are always * uninitialized, we use the pointers themselves * as storage for the Ptrlists. */ union Ptrlist { Ptrlist *next; State *s; }; /* Create singleton list containing just outp. */ Ptrlist* list1(State **outp) { Ptrlist *l; l = (Ptrlist*)outp; l->next = NULL; return l; } ``` But as I understand, in `union` type, all fields share the same memory. So why can we set `l->next=NULL` after casting `l=(Ptrlist*)outp;` because by doing that, we that that memory location to `NULL` and `l` will become `NULL`? [1]: https://swtch.com/~rsc/regexp/nfa.c.txt
<c><pointers><unions>
2019-05-23 16:41:39
LQ_EDIT
56,280,736
AlertDialog without context in Flutter
<p>I want to show an AlertDialog when a http get fails. The function showDialog (<a href="https://api.flutter.dev/flutter/material/showDialog.html" rel="noreferrer">https://api.flutter.dev/flutter/material/showDialog.html</a>) has the parameter "@required BuildContext context", but I want to call the AlertDialog from my async function getNews(), which hasn't a context value. </p> <p>By analogy with Java, where I use null for dialog without an owner, I tried to put context value to null, but it is not accepted.</p> <p>This is my code:</p> <pre><code> Future&lt;dynamic&gt; getNews() async { dynamic retVal; try { var response = await http.get(url)); if (response.statusCode == HttpStatus.ok) { retVal = jsonDecode(response.body); } } catch (e) { alertDlg(?????????, 'Error', e.toString()); } return retVal; } static Future&lt;void&gt; alertDlg(context, String titolo, String messaggio) async { return showDialog&lt;void&gt;( context: context, barrierDismissible: false, // user must tap button! builder: (BuildContext context) { return AlertDialog( title: Text(titolo), ... ); } </code></pre>
<dart><flutter><dialog>
2019-05-23 18:05:29
HQ
56,281,043
onClick = {function(){model.clicks += 1; render(); }}
My question is how do I convert the function below into an arrow function? onClick = {function(){model.clicks += 1; render(); }}
<javascript>
2019-05-23 18:28:37
LQ_EDIT
56,283,753
Sudden SQL problem - need to understand the source of the issue
So I have a list of servers as a website - out of no where - when you try to add a new server it gives an error - https://media.discordapp.net/attachments/346650145565179904/545234753142652932/unknown.png?width=1063&height=598 I went ahead and set a default value for it in phpymadmin, it asked for default values of more things - and after I set it it gave me some problems with the database. Any ideas what could be the source of this issue and where I could try to fix it?
<php><sql>
2019-05-23 22:38:34
LQ_EDIT
56,285,197
What is the difference between enterAnim & popEnterAnim & exitAnim & popExitAnim?
<p>What is the difference between animation tags in latest Navigation Architecture Component? I got confused with <code>enterAnim</code> &amp; <code>popEnterAnim</code>. Similarly, <code>exitAnim</code> &amp; <code>popExitAnim</code>.</p> <p>Any visual expansions is more than welcomed.</p>
<android><android-animation><android-architecture-navigation>
2019-05-24 02:44:13
HQ
56,285,288
Java : find all combinations of strings character by character
If I have for instance CAT, In JAVA, I want all possible combinations of characters with 1 character change at a time (excluding the combination CAT): AAT BAT DAT EAT . . . ZAT CBT CCT CDT . . . CZT CAA CAB CAC . . . CAZ
<java>
2019-05-24 02:59:19
LQ_EDIT
56,286,235
In Spring, @Async is working better when we don't define an manual executor
What is the use of defining manual thread executor inside the @Async annotation in spring? When we don't define executor, the @Async is working better. Use case: I have created a manual thread pool with max pool size is 50. If we pass 200 requests it process only up to 50 requests. But if we don't define manual thread executor for @Async, it is working fine. @Async("manualThreadExecutor") - Stops after max pool size @Async - works fine
<java><spring><multithreading><spring-boot><threadpool>
2019-05-24 05:14:43
LQ_EDIT
56,287,158
HOW TO REMOVE stdClass Object IN CODEIGNITER PHP
**HOW TO REMOVE stdClass Object IN PHP** I AM USING `**$detail['shipping'] = $this->Mymodel->Tcs_get_data('shipment_master');**` IN CONTROLLER HERE IS MY ARRAY VIEW IN VIEW PAGE USING PRINT_R ($shipping); Array ( [0] => stdClass Object ( [sc_id] => 1 [sc_amount_s] => 0 [sc_amount_e] => 4999 [sc_charges] => 150 [sc_status] => 0 [sc_delete] => 0 ) [1] => stdClass Object ( [sc_id] => 2 [sc_amount_s] => 5000 [sc_amount_e] => 9999 [sc_charges] => 100 [sc_status] => 0 [sc_delete] => 0 ) [2] => stdClass Object ( [sc_id] => 4 [sc_amount_s] => 10000 [sc_amount_e] => 99999 [sc_charges] => 0 [sc_status] => 0 [sc_delete] => 0 ) )
<php><codeigniter>
2019-05-24 06:44:05
LQ_EDIT
56,287,373
How @Repository annotation works internally in spring MVC?
<p>I am working on Spring project and there is a requirement to use stereotype annotations in project. I am trying understand how stereotype annotation @Repository works in Spring MVC application?</p>
<java><spring><spring-mvc>
2019-05-24 07:00:32
LQ_CLOSE
56,288,808
Python: split all occurences and keep separator
I've already read [this][1] and [this][2] and [this][3] and lots of others. They don't answer to my problem. I'd like to filter a string that may contain emails **or** strings starting by "@" (like emails but without the text before the "@"). I've tested many ones but one of the simplest that begins to get close is: import re re.split(r'(@)', "test @aa test2 @bb @cc t-es @dd-@ee, test@again") Out[40]: ['test ', '@', 'aa test2 ', '@', 'bb ', '@', 'cc t-es ', '@', 'dd-', '@', 'ee, test', '@', 'again'] I'm looking for the right regexp that could give me: ['test ', '@aa test2 ', '@bb ', '@cc t-es ', '@dd-', '@ee', 'test@again'] [1]: https://stackoverflow.com/questions/2136556/in-python-how-do-i-split-a-string-and-keep-the-separators [2]: https://www.w3schools.com/python/ref_string_split.asp [3]: https://www.programiz.com/python-programming/regex
<python><regex>
2019-05-24 08:37:14
LQ_EDIT
56,289,090
Assign a number to signal's name
I am about to use random numbers to choose a signal but can't assign the number to that signal's name. In this code, I have three input ports which their name are: A1B, A2B, A3B, A4B now I want to use them randomly by a rand function between 1 to 4. ```rand = 4, then input A4B selected.``` ```rand = 2, then input A2B selected.``` ```rand = 3, then input A3B selected.``` This is not an array that I use simple ().
<vhdl><modelsim>
2019-05-24 08:53:59
LQ_EDIT
56,291,492
How to save a file in vscode-remote SSH with a non-root user privileges
<p>I am not able to save any files on my remote server with VSCode Remote SSH because I am not a root user.</p> <p>I've followed the <a href="https://code.visualstudio.com/docs/remote/ssh" rel="noreferrer">official documentation</a> about how to set up ssh with SSH config file but even if my user as sudo privileges, I can't find any options in VSCode to save with sudo.</p> <p>here is my SSH config file <code>/Users/geoff/.ssh/config</code>:</p> <pre><code>Host gcpmain User geoff HostName &lt;IP_ADDRESS&gt; IdentityFile ~/.ssh/gc_rsa </code></pre> <p>Obviously, when I try to save any files that require sudo I have this expected error message:</p> <pre><code>Failed to save 'default': Unable to write file (NoPermissions (FileSystemError): Error: EACCES: permission denied, open '/etc/nginx/sites-available/default') </code></pre> <p>Is there any way that I can force VSCode to save as sudo? Thanks a lot for your answers! :)</p>
<vscode-remote>
2019-05-24 11:11:42
HQ
56,291,534
How i can create generator string with ONLY ONE special character?
<p>i want to create generator string with one special character. Just only one. Can u help me ?.</p> <p>I tried searched the generator on the internet but i saw only generatorspecial characters with a lot of special characters i need "ONLY ONE SPECIAL CHARACTER".</p> <p>PHP 7</p>
<php><string><character><generator>
2019-05-24 11:13:39
LQ_CLOSE
56,294,961
Robolectric fails on command line but succeeds in Android Studio
<p>I have a test where I use Robolectric which succeeds in Android Studio, but does not on the command line.</p> <p>I use Robolectric 4.2 and the test involves a cipher which I partially mock for this test.</p> <pre><code>//How the cipher is created val mockCipher = object : Cipher(MockCipherSpi(), null, null) {} </code></pre> <p>The MockCipher basically just returns the unencrypted input:</p> <pre><code>class MockCipherSpi : CipherSpi() { ... private val algorithmParametersSpi: AlgorithmParametersSpi? = object : AlgorithmParametersSpi() { ... override fun &lt;T : AlgorithmParameterSpec?&gt; engineGetParameterSpec(paramSpec: Class&lt;T&gt;?): T { return IvParameterSpec(byteArrayOf()) as T } } ... override fun engineGetParameters(): AlgorithmParameters { return object : AlgorithmParameters(algorithmParametersSpi, null, null) { init { init(byteArrayOf()) } } } } </code></pre> <p>The reason my test fails is that I get a null pointer exception when I try to get the IV from the cipher:</p> <pre><code>cipher.parameters.getParameterSpec(IvParameterSpec::class.java).iv </code></pre> <p>This works perfectly fine for Android Studio and I can even debug it, but running it from the command line with <code>./gradlew test</code> this fails.</p> <pre><code>java.lang.NullPointerException at javax.crypto.Cipher.&lt;init&gt;(Cipher.java:268) at the place where I try to access the iv at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.robolectric.RobolectricTestRunner$HelperTestRunner$1.evaluate(RobolectricTestRunner.java:601) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.robolectric.internal.SandboxTestRunner$2.evaluate(SandboxTestRunner.java:260) at org.robolectric.internal.SandboxTestRunner.runChild(SandboxTestRunner.java:130) at org.robolectric.internal.SandboxTestRunner.runChild(SandboxTestRunner.java:42) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.robolectric.internal.SandboxTestRunner$1.evaluate(SandboxTestRunner.java:84) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:116) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:59) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:39) at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:66) at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32) at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy.$Proxy1.processTestClass(Unknown Source) at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:146) at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:128) at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) at java.lang.Thread.run(Thread.java:748) </code></pre> <p>It seems there are two <code>javax.crypto.Cipher</code> one from the in the android.jar and one in the jce.jar I assume that AS is using one and the gradle command the other.</p> <p>Do I have to tell gradle to use an other jar or can I solve this problem otherwise? </p>
<android><kotlin><junit><robolectric>
2019-05-24 14:45:28
HQ
56,296,356
When program is running, file is not read
<p>Can someone help me with understanding why this code isn't working, when program is running, "booklist.txt" can't be loaded. </p> <p>When I call function listbooks while the program is running, it doesn't display anything on the screen, so that's the main problem. (file is not empty.)</p> <pre><code> #include &lt;iostream&gt; #include &lt;cstdlib&gt; #include &lt;fstream&gt; using namespace std; void listbooks() { ifstream TheFile("booklist.txt"); char autor; char bookname; long int isbn; while (TheFile &gt;&gt; autor &gt;&gt; bookname &gt;&gt; isbn) { cout &lt;&lt; autor &lt;&lt; " " &lt;&lt; bookname &lt;&lt; " " &lt;&lt; isbn &lt;&lt; endl; } } int main() { int choice; do { cout &lt;&lt; "1.List all books" &lt;&lt; endl; cout &lt;&lt; "2.Borrow book" &lt;&lt; endl; cout &lt;&lt; "3. Exit" &lt;&lt; endl; cout &lt;&lt; "Enter your choice: "; cin &gt;&gt; choice; switch (choice) { case 1: listbooks; break; case 2: break; default: cout &lt;&lt; ""; } } while (choice != 3); system("pause"); return 0; } </code></pre>
<c++>
2019-05-24 16:23:25
LQ_CLOSE
56,297,449
SQL INSERT statement is not executing but I am not receiving an exception either
On my button click event I am just wanting to insert a row into a table. When i click the button i get no exception and i also don't get my messagebox to show either. I have the messagebox as a way to check to see if the query had been executed. When i step through it skips the MessageBox and doesn't throw an exception. private void BtnSend_Click(object sender, EventArgs e) { string theDate = dateTimePicker1.Value.ToString("MM-dd-yyyy"); var select = "INSERT INTO Trinity3(Date, Device_S_N, Student_Last_Name, Student_First_Name, Student_Number, School, Grade, Damage)" + "VALUES (@Date, @Serial, @LastName, @FirstName, @StudentNum, @School, @Grade, @Damage)" + "COMMIT"; SqlConnection connection = new SqlConnection("Data Source=CPS1113020004; Initial Catalog=Coweta Public Schools; Integrated Security=True"); //Create a SqlCommand instance SqlCommand command = new SqlCommand(select, connection); //Add the parameter command.CommandType = CommandType.Text; command.CommandText = select; command.Parameters.AddWithValue("@Date", theDate); command.Parameters.AddWithValue("@Serial",txtSerial.Text); command.Parameters.AddWithValue("@LastName",txtLastName.Text); command.Parameters.AddWithValue("@FirstName",txtFirstName.Text); command.Parameters.AddWithValue("@StudentNum", txtStudentNum.Text); command.Parameters.AddWithValue("@School",txtSchool.Text); command.Parameters.AddWithValue("@Grade", txtGrade.Text); command.Parameters.AddWithValue("@Damage", txtDamage.Text); //Execute the query try { connection.Open(); command.ExecuteNonQuery(); MessageBox.Show("Records Inserted Successfully"); } catch { //Handle exception, show message to user... } finally { connection.Close(); } this.Visible = false; var searchForm = new SearchForm(); searchForm.ShowDialog(); }
<c#><sql-server><winforms>
2019-05-24 17:53:00
LQ_EDIT
56,297,453
Is there a way to check if an element is enabled only after let's say 30 seconds
I have a link in my application which gets enabled after 30 seconds. I have to verify this scenario using selenium , that the link only gets enabled after 30 seconds not before that. I have used fluent wait but it didn't work.
<selenium><selenium-webdriver><try-catch><webdriverwait><fluentwait>
2019-05-24 17:53:14
LQ_EDIT
56,297,657
Convert casual string to int in C
<p>As the title I need to convert a casual string (like "elephant") to a int type. I already know about <em>atoi</em> and <em>strtol</em> function of <em>stdlib.h</em> library. However this ones do not work on casual string (the return value is always 0). Does a function like this exist yet?</p>
<c><string><int>
2019-05-24 18:08:21
LQ_CLOSE
56,297,983
create-react-app generates function instead of class in App.js
<p>I'm trying to create react app using create-react-app command, and it's generating the App.js file as function (es5 syntax without class) instead of class (Example in the following code):</p> <pre><code>import React from 'react'; import logo from './logo.svg'; import './App.css'; function App() { return ( &lt;div className="App"&gt; &lt;header className="App-header"&gt; &lt;img src={logo} className="App-logo" alt="logo" /&gt; &lt;p&gt; Edit &lt;code&gt;src/App.js&lt;/code&gt; and save to reload. &lt;/p&gt; &lt;a className="App-link" href="https://reactjs.org" target="_blank" rel="noopener noreferrer" &gt; Learn React &lt;/a&gt; &lt;/header&gt; &lt;/div&gt; ); } export default App; </code></pre> <p>How can I force create-react-app to generate class instead?</p>
<reactjs><create-react-app>
2019-05-24 18:35:42
HQ
56,298,061
Python - Get number of items in list not equal to something
<p>How do you get the number of items that are NOT 204 in this list?</p> <pre><code>data = [204, 204, 204, 500, 204, 204, 500, 500, 204, 404] number_of_not_204 = any(x != 204 for x in data) # returns True print number_of_not_204 # looking to get the number 4 (500, 500, 500, and 404 are not 204) </code></pre>
<python>
2019-05-24 18:42:48
LQ_CLOSE
56,298,610
How to add a variable amount of variables in a list
<p>Is there a way to append a variable amount of variables in a list in python? I want the number of variables in my list to be equal to y (y = 5)</p>
<python><list><append><extend>
2019-05-24 19:31:25
LQ_CLOSE
56,298,775
how to login to instagram on dev computer
<p>I am trying to create a wordpress plugin that will display images from my company's instagram account. My dev computer is on my desktop computer behind the company's firewall. My understanding (which could be wrong) is that the page will have to go to the instagram site to get an access token, and then the token is returned to a specified redirect url. Is there any way I can get access to this while behind the firewall on my local desktop (that obviously has no direct connection to the outside)? </p>
<php><wordpress><api><instagram><access-token>
2019-05-24 19:49:46
LQ_CLOSE
56,299,256
Need Help in understanding AWK script logic
<p>I need help in understanding the below code logic written in AWK by one of our collegues in the past. Can anyone with good AWK knowledge help me to understand this code.</p> <p>Thanks, Sandeep</p> <pre><code>sed -i 's/\r//g' $1 $2 sed -i 's/,/;/g' $1 $2 awk -F"|" '{if(FILENAME=="Parameter.txt"){a[$1]=NR;aa[NR]=$1;d=NR;if(NR==1){e=$1}else{e=e","$1};} else if(FILENAME=="Traffic.csv"){h[FNR","$2]=$3;x[FNR","$4]=$5;k[FNR","$2","$3","$4","$5]=$1;y=FNR;} else if(FILENAME=="Filter.txt"){for(i=1;i&lt;=NF;i=i+3){if($(i+1)!="ne"){FE[FNR","$i]=$(i+2)}else{FNE[FNR","$i]=$(i+2)}};FILTER=FNR;FC[FNR]=(NF/3);} else{ if(g==""){print e",TRAFFIC_CASE";g=1}; for(i=1;i&lt;=d;i++){c[i]=""};l="";m="";z="";FINAL="";for(j=1;j&lt;=FILTER;j++){FI[j]=""}; for(i=1;i&lt;=NF;i++){ split($i,b,"="); if(a[b[1]]!=""){c[a[b[1]]]=b[2];}; for(j=1;j&lt;=y;j++){ if(h[j","a[b[1]]]==b[2] &amp;&amp; h[j","a[b[1]]]!=""){l=a[b[1]]","b[2]}; if(x[j","a[b[1]]]==b[2] &amp;&amp; x[j","a[b[1]]]!=""){z=a[b[1]]","b[2]}; if(k[j","l","z]!=""){m=k[j","l","z]};}; }; if(substr(FILENAME,20,3)=="SVC"){Q[c[a[MSISDN]]]=1} else if(Q[c[a[MSISDN]]]!=1){ for(i=1;i&lt;=d;i++){ if(i==1){f=c[1];}else{f=f","c[i]}; if(c[i]==""){c[i]="B"}; for(j=1;j&lt;=FILTER;j++){ if(FE[j","i]!=""){if(FE[j","i]==c[i] &amp;&amp; (FI[j]=="" || FI[j]&lt;=FC[j])){FI[j]=FI[j]+1;}else{FI[j]=FI[j]-1;}}; if(FNE[j","i]!=""){if(FNE[j","i]!=c[i] &amp;&amp; (FI[j]=="" || FI[j]&lt;=FC[j])){FI[j]=FI[j]+1;}else{FI[j]=FI[j]-1;}}; }; }; } for(j=1;j&lt;=FILTER;j++){if(FI[j]==FC[j]){FINAL=1};}; if(FINAL!=1){print f","m;}; }; }' Parameter.txt Traffic.csv Filter.txt $2 $1 </code></pre>
<shell><awk>
2019-05-24 20:36:20
LQ_CLOSE
56,299,427
Why this query to get friends is returning FALSE?
I have a table named friends which contains 3 fields user1id, user2id and status. Status is a foreign key to an another table FriendshipStatuses and both of the other fields are foreign keys to user's table. So I tried some different queries which resulted in false and getting friendships that were still in request.The query I provided is returning FALSE. $userId contains the current logged in user's id `SELECT users.username, users.fullName, users.user_id FROM users WHERE users.user_id IN(SELECT user1id, user2id WHERE user1id=$userId OR user2id = $userId)`
<sql>
2019-05-24 20:53:30
LQ_EDIT
56,299,816
Errors while seeing vars up to zero in "If-else"
I've got problem with UiTextField. It shows ,,Expected expression", ,,Expression resolves to an unused property", ,,Consecutive statements on a line must be separated by ';'" errors. I've implemented the function like this: if var1 != nil && var2 != nil && var3 != nil { self.var1.delegate = (self as! UITextFieldDelegate) self.var2.delegate = (self as! UITextFieldDelegate) self.var3.delegate = (self as! UITextFieldDelegate) // Do any additional setup after loading the view. } else { var1: Double = 0 // <- errors up here var2: Double = 0 var3: Double = 0 } } If I delate the var1 error goes to the line below. Thanks for help
<ios><swift><uitextfield>
2019-05-24 21:41:54
LQ_EDIT
56,301,857
How do i parse this response so I ONLY GET THE NAME AND bot ID
I'm trying to just parse this so that I only get the name and bot_id I used json.loads and did things like for item in response: print item['bot_id'] Right now I'm just most concerned with getting the bot_id def view_bot_ids(): response = json.loads(requests.get("https://api.groupme.com/v3/bots?token=CANTSHOWTHIS")._content) print response THIS IS THE OUTPUT {u'meta': {u'code': 200}, u'response': [{u'group_id': u'49818165', u'name': u'Johnny Five', u'dm_notification': False, u'group_name': u'Travis Manion Presentation', u'avatar_url': None, u'callback_url': None, u'bot_id': u'240b08e530d42f286f30a75379'}, {u'group_id': u'48672722', u'name': u'Johnny Five', u'dm_notification': False, u'group_name': u'DevOps Autodidact', u'avatar_url': None, u'callback_url': None, u'bot_id': u'64395a02a9382796f7cd7616ef'}, {u'group_id': u'48402248', u'name': u'suck ya mom', u'dm_notification': False, u'group_name': u'Free Flicks', u'avatar_url': None, u'callback_url': None, u'bot_id': u'42aacdb69615721d68c31d71c0'}, {u'group_id': u'43195303', u'name': u'The goat', u'dm_notification': False, u'group_name': u'2nd Floor Boiz', u'avatar_url': None, u'callback_url': None, u'bot_id': u'd45a95b6bbb344639104fd6a3a'}]} All I want from this, is all the bot_ids and name All I want it to output is the array of bot ids or array of names
<python><json><python-requests>
2019-05-25 05:01:38
LQ_EDIT
56,302,343
In mysql how to clear the missing parenthesis error?
CREATE TABLE Bill( BillNo INTEGER PRIMARY KEY, StoreName VARCHAR2(20) FOREIGN KEY, Shopperid INTEGER FOREIGN KEY, ArCode CHAR(5) FOREIGN KEY, Amount INTEGER, BillDate DATE, Quantity NUMBER(4) Default 1 Check (Quantity>0)); Im getting missing paranthesis error.somebody help me with the code?
<sql><oracle>
2019-05-25 06:26:59
LQ_EDIT
56,302,566
SyntaxError: Unexpected token }
<p>the code worked until line 48, after which it no longer worked. I would like to implement the switch on the "move" button on line 50-62, but this gave me the error Error: Uncaught SyntaxError: Unexpected token }</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="1.js"&gt;&lt;/script&gt; &lt;title&gt;Prova Jquery&lt;/title&gt; &lt;!-- Fogli di stile --&gt; &lt;!-- Required meta tags --&gt; &lt;meta charset="utf-8"&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"&gt; &lt;!-- Bootstrap CSS --&gt; &lt;link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"&gt; &lt;body&gt; &lt;div class="container" id="effetti"&gt; &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisci elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur Lorem ipsum dolor sit amet, consectetur adipisci elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur&lt;/p&gt; &lt;a href="https://www.google.it/"&gt;vai su google&lt;/a&gt; &lt;button type="button "id="nascondi-immagine"&gt;Nascondi &lt;/button&gt; &lt;button type="button" id="mostra-immagine"&gt;Mostra &lt;/button&gt; &lt;button type="button" id="sposta-immagine"&gt;Sposta &lt;/button&gt; &lt;p&gt;&lt;img src="blu.jpg" \&gt;&lt;/p&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>file 1.js :</p> <pre><code>$(function(){ $("#effetti") .fadeIn(12000);//effetto opacita in 12 secondi $("#effetti")//sul DIV che si chiama effetti .on({ //permette di fare qualcosa intercettando un evento (click, mouseover, onclick..) mouseover: function(){//creo una function anonima console.log("MOUSE OVER"); }, //sotto scrivo un'altra funzione sempre ANONIMA click: function(){//tutte le volte che scrivo "nome-evento" e due punti dentro gli passo un oggetto console.log("CLICK"); } }); $("#nascondi-immagine") .on({ click:function(){//quando faccio click $("img").hide();//devi nascondere l'immagine } }); $("#mostra-immagine") .on({ click:function(){ $("img").fadeIn(3000);//immagine deve comparire in 3' } }); //prEventDefault serve a prevenire il comportamento di default del dom html $("#effetti a")//sul DIV che si chiama effetti SELEZIONO gli elementi a .on({ //permette di fare qualcosa intercettando un evento (click, mouseover, onclick..) click:function(e){//passo un parametro "e" che corrisponde all'elemento "a" in pratica e.preventDefault(); } }); $(window) .on("load", function(){ $("#effetti") .css({ "margin-top":10% }); }); $(window)//l'oggetto window di js .on("load",function(){//scrivo load ed apro un function anonima $("#sposta-immagine") .on({ click:function(){//al compimento di questa azione ovvero click su bottone $("effetti")//sul DIV che si chiama effetti .css({ "background":"red", "margin-left":10% }); } }); }); }); </code></pre> <p>when I update the 1.js file even if I delete the function from line 50-62 it continues to give me the usual error. in the sense the google chrome console always gives me the old error on that code even if that code has been deleted</p>
<jquery><unexpected-token>
2019-05-25 07:05:43
LQ_CLOSE
56,302,643
How can I remove multiple occurrences from a string in python?
<p>I have a string like 'AABA'. I want to remove multiple occurances by removing others. The result should be 'AB'. Sample Input: AABA Sample Output: AB</p>
<python>
2019-05-25 07:15:46
LQ_CLOSE
56,303,037
Regular expression
<p>I want regex to match Google.com to apple.com YouTube.com but not admin.google.com payment.apple.com admingoogle.com student.google.admin.co.in etc</p>
<php><regex>
2019-05-25 08:12:30
LQ_CLOSE
56,303,906
link textbox with listbox in userform
guys i have two textbox one for search to show data from sheet to listbox and the other to show value what i would is any code to show value in textbox2 after show the data in list box the list box have 7 column the total value which show in textbox from the column7 automatically without any command button
<excel><vba>
2019-05-25 10:21:55
LQ_EDIT
56,303,939
C++ std::variant vs std::any
<p>C++17 presents <a href="https://en.cppreference.com/w/cpp/utility/variant" rel="noreferrer"><code>std::variant</code></a> and <a href="https://en.cppreference.com/w/cpp/utility/any" rel="noreferrer"><code>std::any</code></a>, both able to store different type of values under an object. For me, they are somehow similar (are they?).</p> <p>Also <code>std::variant</code> restricts the entry types, beside this one. Why we should prefer <code>std::variant</code> over <code>std::any</code> which is simpler to use?</p>
<c++><c++17>
2019-05-25 10:25:37
HQ
56,306,371
Can't handle with regexp, could you provide some hint?
I need to split this string by space: ``` <i>Lorem</i> 1 <span class="text-danger">ipsum</span> dolor sit amet, consectetur adipisicing elit. Animi consequuntur, eos? Error facere maiores minima molestiae obcaecati, quis voluptatum. Aspernatur cumque doloremque ducimus eos explicabo facilis fuga, nulla quos voluptate. ``` The difficulty is that I also have html tags inside. I tried something like this, but it takes spaces as well ``` /<(.*?)>(.*?)<(.*?)>|\w*(.*?)(?:\s*?[,?.-])?/g ``` Could you please help to fix my regexp?
<javascript><regex><string><split>
2019-05-25 15:48:06
LQ_EDIT
56,309,573
Syntax error in MySQL INSERT INTO statement
<p>there is some problem with my code. Everytime I try to insert something into the database, I get the syntax error.</p> <p>Here is my database structure:</p> <pre class="lang-sql prettyprint-override"><code>CREATE TABLE `notes` ( `id` int(12) NOT NULL, `type` varchar(15) NOT NULL, `title` varchar(43) NOT NULL, `text` varchar(43) NOT NULL, `group` varchar(32) NOT NULL, `uid` int(64) NOT NULL, `creator` int(64) NOT NULL, `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ALTER TABLE `notes` ADD PRIMARY KEY (`id`); ALTER TABLE `notes` MODIFY `id` int(12) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=79; </code></pre> <p>And thats my code</p> <pre class="lang-php prettyprint-override"><code>&lt;?php session_start(); require '../config.php'; $notetype = $_POST['type']; $notetitle = $_POST['title']; $notetext = $_POST['text']; $notegroup = $_POST['group']; $noteuid = $_POST['uid']; $notecreator = $_POST['creator']; $notetbname = $note['tbname']; $conn = new mysqli($databaseconfig['ip'], $databaseconfig['user'], $databaseconfig['pass'], $databaseconfig['dbname']); if ($conn-&gt;connect_error) { die("Connection failed: " . $conn-&gt;connect_error); } $sql = "INSERT INTO $notetbname (type, title, text, group, uid, creator) VALUES ('$notetype', '$notetitle', '$notetext', '$notegroup', $noteuid, $notecreator);"; if ($conn-&gt;query($sql) === TRUE) { echo "New record created successfully"; } else { echo "Error: " . $sql . "&lt;br&gt;" . $conn-&gt;error; } $conn-&gt;close(); ?&gt; </code></pre> <p>This is what I get as error message:</p> <pre class="lang-sql prettyprint-override"><code>Error: INSERT INTO notes (type, title, text, group, uid, creator) VALUES ('player', 'Hello there', 'Good morning everybody', 'Cop', 3325, 103); You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'group, uid, creator) VALUES ('player', 'Hello there', 'Good morning everybody'' at line 1 </code></pre>
<php><mysql><sql>
2019-05-25 23:45:06
LQ_CLOSE
56,311,172
Remove li from a dynamic list using blade and jquery
I have a dynamically populated list. On clicking on the Approve/reject button, an ajax call happens. If the response is 1, the div should be hidden from the UI. Below is my code. The remove() option doesn't seem to work. Can't figure out a way. Approve.blade.php <ul> @foreach($pendlist as $pend) <li id="{{$pend->id}}"> <div class="list-box-listing"> <div class="list-box-listing-img"><a href="#"><img src="images/listing-item-01.jpg" alt=""></a></div> <div class="list-box-listing-content"> <div class="inner"> <h3><a href="#">{{$pend->title}}</a></h3> <span>{{$pend->address}}, {{$pend->locality}}, {{$pend->city}}</span> <div class="star-rating" data-rating="3.5"> <div class="rating-counter">(12 reviews)</div> <input type="hidden" value="{{$pend->id}}" id="propid"> </div> </div> </div> </div> <div class="buttons-to-right"> <a href="#" class="button gray reject" id="reject"><i class="sl sl-icon-close"></i> Reject</a> <a href="#" class="button gray approve" id="approve"><i class="sl sl-icon-check"></i> Approve</a> </div> </li> @endforeach </ul> the jquery: $('#approve').click(function(){ $.ajax({ type: "POST", url: "{{ url('/api/approve') }}", async: true, data: { id: $('#propid').val(), status: 1 }, success: function(result){ let id = $('#propid').val(); if(result == 1){ $(this).remove(); } },error: function(XMLHttpRequest, textStatus, errorThrown) { alert(errorThrown); $("#loader").hide(); } }); I have tried $(this).closest('li').remove() But that also doesn't seem to work. Any help highly appreciated.
<jquery><laravel-5.5>
2019-05-26 06:22:41
LQ_EDIT
56,311,479
how to delete only 10 digits numbers from a text file which contains array of both alpha numerical and numbers
Let's say i have a text file which contains both alphanumerical values and only numerical values of length 10 digits line by line, like the one shown below. abcdefgh 0123456789 edf6543jewjew 9876543219 here i want to delete all the lines which contains only those random 10 digit numbers **how to do this in python 3.x?**
<python-3.x>
2019-05-26 07:19:32
LQ_EDIT
56,311,685
Using a For Loop to change an If statement
<p>Just a real quick one. I has a list of variables which only change by 1 digit. I want my <code>if</code> statement to refer to each individual variable, but I'm not sure how to go about it. Can you help me out?</p> <pre><code>CheckGabba1 = IntVar() CheckGabba2 = IntVar() CheckGabba3 = IntVar() ## etc. (x10) ## There are items in these lists (This is just to show that they are lists) AllEventsGabba = [] SelectedEventsGabba = [] NumEvents = 10 ListIndex = 0 for EventCheck in range(NumEvents): if (CheckGabba(ListIndex + 1)).get() == 1: SelectedEventsGabba.append(AllEventsGabba[ListIndex]) ListIndex += 1 else: ListIndex += 1 </code></pre> <p>Obviously <code>(CheckGabba(ListIndex + 1)</code> is wrong, but I'm not sure what it needs to be replaced with to get the loop to autonomously check each variable, rather than hard-writing (Which I can do, but would prefer not to).</p>
<python>
2019-05-26 07:51:35
LQ_CLOSE
56,312,806
Minecraft 1.12.2 ping von Spieler Ermitteln
ich wollte von einem Spieler die Ping ermitteln. In der Version 1.8.8 hat auch alles super Funktioniert, aber wenn ich den Code auf der 1.12.2 anwende, kommen da unlogische ergebnisse raus. Ich bekomme auf meinem localhost eine Ping von 200 oder so zurΓΌck, obwohl ich auf dem 1.8er server einen 0er ping habe. Ist ja auch klar, weil Localhost... Ich habe es auf meinem Root server und auf meinem Localhost getestet. Ich habe gegoogled aber immer nur tutorials fΓΌr die 1.8 gefunden ```Java package de.n1ck145.ping.main; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.command.ConsoleCommandSender; import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; public class Main extends JavaPlugin{ private String prefix; private String message; private ConsoleCommandSender console; @Override public void onEnable() { console = Bukkit.getConsoleSender(); getConfig().options().copyDefaults(true); saveConfig(); prefix = getConfig().getString("prefix"); prefix = ChatColor.translateAlternateColorCodes('&', prefix); message = getConfig().getString("pingMessage"); message = ChatColor.translateAlternateColorCodes('&', message); console.sendMessage(prefix + "Β§aPlugin ready!"); } @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if(command.getName().equalsIgnoreCase("ping")) { if(!(sender instanceof Player)) { sender.sendMessage(prefix + "Β§cYou must be a player!"); return false; } if(sender.hasPermission("cmd.ping")) { sender.sendMessage(message.replace("%ping%", getPing((Player) sender) + "")); }else sender.sendMessage(prefix + "Β§cYou don't have permission to do this!"); } return true; } private int getPing(Player p) { return ((CraftPlayer) p).getHandle().ping; } } ```
<java><ping><minecraft>
2019-05-26 10:45:29
LQ_EDIT
56,313,083
Ansible + Ubuntu 18.04 + MySQL = "The PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) module is required."
<p>I’m seeing the above message on multiple playbooks using Ansible 2.8 on Ubuntu 18.04. In the interests of simplicity I’ve reproduced it using this basic playbook for a single node Drupal server. <a href="https://github.com/geerlingguy/ansible-for-devops/tree/master/drupal" rel="noreferrer">https://github.com/geerlingguy/ansible-for-devops/tree/master/drupal</a>; this playbook works fine on earlier versions of ubuntu, but not on 18.04 which I understand includes python3 by default.</p> <p>I’ve used vagrant to create the base machine, which shows the following:</p> <pre><code>$ which python /usr/bin/python $ which python2 /usr/bin/python2 $ which python3 /usr/bin/python3 $ python --version Python 2.7.15rc1 $ python2 --version Python 2.7.15rc1 $ python3 --version Python 3.6.7 </code></pre> <p>Which seems to be telling me that both python 2 and python 3 are installed, but that 2.7 is the default as that is what responds to $ python --version. </p> <p>I have tried all the suggestions described in this article: <a href="https://www.rollnorocks.com/2018/12/ansible-python-and-mysql-untangling-the-mess/" rel="noreferrer">https://www.rollnorocks.com/2018/12/ansible-python-and-mysql-untangling-the-mess/</a> Including specifying the </p> <pre><code>ansible_python_interpreter=/usr/bin/python3 </code></pre> <p>But nothing affects the message. The edited -vvv output from the playbook run is below. Has anyone got any more ideas about either the problem or solution.</p> <pre><code>TASK [Remove the MySQL test database.] **************************************************************************************************************************** task path: /vagrant/provisioning/playbook.yml:96 &lt;10.1.1.11&gt; ESTABLISH SSH CONNECTION FOR USER: mt-ansible-user &lt;10.1.1.11&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o . . . Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/database/mysql/mysql_db.py &lt;10.1.1.11&gt; PUT /home/mt-tools-user/.ansible/tmp/ansible-local-21287bh5dK5/tmp7pOKOH TO /home/mt-ansible-user/.ansible/tmp/ansible-tmp-1558868136.49-16683638151793 1/AnsiballZ_mysql_db.py &lt;10.1.1.11&gt; SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/mt-tools-user/.ssh/mt_ansible_rsa"' -o KbdInteractiveAuthent ication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="mt-ansible-user"' -o ConnectTimeout= 10 -o ControlPath=/home/mt-tools-user/.ansible/cp/af4de51057 '[10.1.1.11]' &lt;10.1.1.11&gt; (0, 'sftp&gt; put /home/mt-tools-user/.ansible/tmp/ansible-local-21287bh5dK5/tmp7pOKOH /home/mt-ansible-user/.ansible/tmp/ansible-tmp-1558868136.49-166836 381517931/AnsiballZ_mysql_db.py\n', '') &lt;10.1.1.11&gt; ESTABLISH SSH CONNECTION FOR USER: mt-ansible-user &lt;10.1.1.11&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/mt-tools-user/.ssh/mt_ansible_rsa"' -o KbdInteractiveAuthenticatio n=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="mt-ansible-user"' -o ConnectTimeout=10 -o ControlPath=/home/mt-tools-user/.ansible/cp/af4de51057 10.1.1.11 '/bin/sh -c '"'"'chmod u+x /home/mt-ansible-user/.ansible/tmp/ansible-tmp-1558868136.49-1668363815 17931/ /home/mt-ansible-user/.ansible/tmp/ansible-tmp-1558868136.49-166836381517931/AnsiballZ_mysql_db.py &amp;&amp; sleep 0'"'"'' &lt;10.1.1.11&gt; (0, '', '') &lt;10.1.1.11&gt; ESTABLISH SSH CONNECTION FOR USER: mt-ansible-user &lt;10.1.1.11&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/mt-tools-user/.ssh/mt_ansible_rsa"' -o KbdInteractiveAuthenticatio n=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="mt-ansible-user"' -o ConnectTimeout=10 -o ControlPath=/home/mt-tools-user/.ansible/cp/af4de51057 -tt 10.1.1.11 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-qwjewg qckuyapsxnkbqoegainrkyiinc ; /usr/bin/python3 /home/mt-ansible-user/.ansible/tmp/ansible-tmp-1558868136.49-166836381517931/AnsiballZ_mysql_db.py'"'"'"'"'"'"'"'"' &amp; &amp; sleep 0'"'"'' &lt;10.1.1.11&gt; (1, 'BECOME-SUCCESS-qwjewgqckuyapsxnkbqoegainrkyiinc\r\n\r\n{"msg": "The PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) module is req uired.", "failed": true, "invocation": {"module_args": {"db": "test", "state": "absent", "name": "test", "login_host": "localhost", "login_port": 3306, "encoding": "", "collation": "", "connect_timeout": 30, "config_file": "/root/.my.cnf", "single_transaction": false, "quick": true, "ignore_tables": [], "login_user": null, " login_password": null, "login_unix_socket": null, "target": null, "client_cert": null, "client_key": null, "ca_cert": null}}}\r\n', 'Shared connection to 10.1.1.11 closed.\r\n') &lt;10.1.1.11&gt; Failed to connect to the host via ssh: Shared connection to 10.1.1.11 closed. &lt;10.1.1.11&gt; ESTABLISH SSH CONNECTION FOR USER: mt-ansible-user &lt;10.1.1.11&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/mt-tools-user/.ssh/mt_ansible_rsa"' -o KbdInteractiveAuthenticatio n=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="mt-ansible-user"' -o ConnectTimeout=10 -o ControlPath=/home/mt-tools-user/.ansible/cp/af4de51057 10.1.1.11 '/bin/sh -c '"'"'rm -f -r /home/mt-ansible-user/.ansible/tmp/ansible-tmp-1558868136.49-16683638151 7931/ &gt; /dev/null 2&gt;&amp;1 &amp;&amp; sleep 0'"'"'' &lt;10.1.1.11&gt; (0, '', '') </code></pre>
<python><mysql><ansible>
2019-05-26 11:27:53
HQ
56,313,767
Creating a trigger from sql view
I have two tables that are updated by one function(GLPOST AND GLPOSTO). I have created a view(GLREP) from this two tables that transpose the rows of GLPOSTO into columns as this is how i want my data. Now i want to create a trigger(OPTIONAL) on this view to insert to a new table(GLREPORTEXCEL) once the view collects the data from the various tables in the view format. View GLREP CREATE VIEW [dbo].[GLREP] AS (SELECT * FROM (SELECT GLPOST.ACCTID,JRNLDATE, GLPOST.FISCALYR, GLPOST.FISCALPERD, GLPOST.SRCECURN, GLPOST.BATCHNBR, GLPOST.ENTRYNBR, GLPOST.JNLDTLDESC, GLPOST.JNLDTLREF, GLPOST.TRANSAMT, GLPOST.CONVRATE,GLPOST.SCURNAMT, GLPOSTO.OPTFIELD,GLPOST.CNTDETAIL, CSOPTFD.VDESC FROM GLPOST left JOIN GLPOSTO ON GLPOST.ACCTID = GLPOSTO.ACCTID AND GLPOST.POSTINGSEQ = GLPOSTO.POSTINGSEQ and glpost.CNTDETAIL=glposto.CNTDETAIL left JOIN CSOPTFD ON GLPOSTO.OPTFIELD = CSOPTFD.OPTFIELD AND GLPOSTO.VALUE = CSOPTFD.VALUE ) as source pivot (MAX([VDESC]) FOR [OPTFIELD] IN (ADVANCE,MEDICAL,MILEAGE,MOTORVEHICLE,PROMOTION,STAFF)) AS PVT ) MY TRIGGER THAT IS NOT WORKING(OPTIONAL) CREATE TRIGGER OPTIONAL ON GLREP for INSERT AS INSERT INTO GLREPORTEXCEL (ACCTID, TRANDATE, FISCALYR, FISCALPERD, SRCECURN, BATCHNBR, ENTRYNBR, JNLDTLDESC, JNLDTLREF, TRANSAMT, CONVRATE, SCURNAMT, CNTDETAIL, STAFF, ADVANCE, MEDICAL, MILEAGE,MOTORVEHICLE,PROMOTION) SELECT ACCTID, JRNLDATE, FISCALYR, FISCALPERD, SRCECURN, BATCHNBR, ENTRYNBR, JNLDTLDESC, JNLDTLREF, TRANSAMT, CONVRATE, SCURNAMT, CNTDETAIL, STAFF, ADVANCE, MEDICAL, MILEAGE,MOTORVEHICLE,PROMOTION FROM inserted NEW TABLE THAT I WANT TO INSERT IS CALLED :GLREPORTEXCEL
<sql-server><tsql><database-trigger>
2019-05-26 13:04:32
LQ_EDIT
56,313,902
Interfaces may not include member variables error
<p>I made an Interface for my project which is called <code>insert</code> and goes like this:</p> <pre><code>&lt;?php interface Insert { private $_db; public function __construct() { $this-&gt;_db = new Connection(); $this-&gt;_db = $this-&gt;_db-&gt;dbConnect(); } public function insert($table_name, $data) { $string = "INSERT INTO ".$table_name." ("; $string .= implode(",", array_keys($data)) . ') VALUES ('; $string .= "'" . implode("','", array_values($data)) . "')"; if(mysqli_query($this-&gt;_db, $string)) { return true; } else { echo mysqli_error($this-&gt;con); } } } ?&gt; </code></pre> <p>But it given me this error:</p> <p><strong>Fatal error: Interfaces may not include member variables</strong></p> <p>So what is my mistake here?</p>
<php><mysql><oop><mysqli><pdo>
2019-05-26 13:25:32
LQ_CLOSE
56,315,198
Equivalent Command for "members" in RHEL
<p>I have requirement to check members of the group "wheel" periodically.</p> <p>I see that 'members wheel' is expected to display the members of that group. However when i tried, it says command not found. I see no entries in the man page as well.</p> <p>I am using RHEL - Linux Version 3.10 (Red Hat 4.8.5)</p> <p>I know we can use awk and cat in combination to get these details from "/etc/group" file</p> <p>But is there a straight forward or a better approach?</p>
<linux><rhel>
2019-05-26 16:06:16
LQ_CLOSE
56,315,356
Select an element place after a element with Jquery
I have this HTML code: <input type="password" name="USR_NewPassword" class="form-control" maxlength="50" required> <span class="input-group-addon"> <a href=""><i class="fa fa-eye"></i></a> </span> Why this isn't working if I would like to select the `<i>` element if clicked ? $('input[name="USR_NewPassword"] span > a').on('click', function(event) { ... });
<javascript><jquery><html>
2019-05-26 16:26:26
LQ_EDIT
56,316,038
Check for multiple numbers in an array
<p>I need to create a function that checks all numbers in an array and print them out. My idea was something similar to this:</p> <pre><code> var array = [15,22,88,65,79,19,93,15,90,38,77,10,22,90,99]; var string = ""; var len = array.length; </code></pre> <p>After declaring the variables, i start to loop them:</p> <pre><code> for (var i = 0; i &lt; len; i ++) { for (var j = 0; j &lt; len; j ++) { //console.log(array[i], array[j]); } } </code></pre> <p>Console prints me value in this order:</p> <pre><code>3 3 3 6 3 67 . . 6 3 6 6 6 67 . . </code></pre> <p>I thought to create a if statement checking if array[i] is equal to array[j] then pushing the content in a new string.</p>
<javascript><arrays><loops>
2019-05-26 17:52:30
LQ_CLOSE
56,318,563
Importxml into Google Sheet automatically
I want to know how to import data using the Importxml function in Google spreadsheets. https://www.tigeretf.com/front/products/product.do?ksdFund=KR7305080004&fundTypeCode=01000800 Above <기쀀가격(원)> I want to import data. importxml(I2,I3) I2 = https://www.tigeretf.com/front/products/product.do?ksdFund=KR7305080004&fundTypeCode=01000800 I3 = //*[@id="container"]/div[2]/div[2]/div[1]/div/table/tbody/tr/td[2]/strong/text() Data is being loaded and can not be refreshed. importxml(I2,I3) I2 = https://www.tigeretf.com/front/products/product.do?ksdFund=KR7305080004&fundTypeCode=01000800 I3 = //*[@id="container"]/div[2]/div[2]/div[1]/div/table/tbody/tr/td[2]/strong/text() I want the <기쀀가격(원)> data to be loaded automatically every time the sheet is refreshed.
<google-sheets><google-sheets-formula><google-sheets-importxml>
2019-05-27 01:09:51
LQ_EDIT
56,319,137
Why does a GraphQL query return null?
<p>I have an <code>graphql</code>/<code>apollo-server</code>/<code>graphql-yoga</code> endpoint. This endpoint exposes data returned from a database (or a REST endpoint or some other service).</p> <p>I know my data source is returning the correct data -- if I log the result of the call to the data source inside my resolver, I can see the data being returned. However, my GraphQL field(s) always resolve to null.</p> <p>If I make the field non-null, I see the following error inside the <code>errors</code> array in the response:</p> <blockquote> <p>Cannot return null for non-nullable field</p> </blockquote> <p>Why is GraphQL not returning the data?</p>
<graphql><graphql-js><apollo-server>
2019-05-27 02:53:40
HQ
56,320,028
How do I check if a particular app is installed on the user's device on iOS?
<p>Is there a function which I can use to check if the user has a particular app installed on their device. Ie, instagram</p>
<ios><swift><instagram>
2019-05-27 05:16:02
LQ_CLOSE
56,320,342
Identfy "Start" and "End" date of a trip in SQL?
I want to get the start and end date of the trip from a table as shown below - [enter image description here][1] I have tried Min(Date) and then Max(Date) Group by Line_Number,Country Also LEAD function Preferred Outcome [enter image description here][2] [1]: https://i.stack.imgur.com/6gZGC.png [2]: https://i.stack.imgur.com/oaL7O.png
<sql><db2>
2019-05-27 05:55:04
LQ_EDIT
56,320,581
Which is better approach?
<p>I need to find subject, but it could be null. So have to do this without throwing exception. I have two approach and please suggest which is better?</p> <pre><code>public static String getSafeSubject(SNSEvent.SNSRecord record){ try{ return record.getSNS().getSubject(); }catch (Exception e){ return "Failed to retrieve subject"; } } </code></pre> <pre><code>public static String getSafeSubject(SNSEvent.SNSRecord record){ if(record == null || record.getSNS() == null || record.getSNS().getSubject() == null){ return "Failed to retrieve subject"; } return record.getSNS().getSubject(); } </code></pre>
<java>
2019-05-27 06:17:43
LQ_CLOSE
56,323,845
What's the output of this program? Explain the answer too please
`void main() { printf("%d",-10 & 5); }` /*Why is the output of this program 4*/
<c><bit-manipulation><operators><bitwise-operators><negative-number>
2019-05-27 10:03:55
LQ_EDIT
56,324,180
Jar files not opening
<p>Okay so im not sure this is the place to ask, But all .jar files on my PC wont open, I don't understand why</p> <p>I've tried reinstalling java, and messed with enviroment variables</p> <p>Thank you for any help</p>
<java>
2019-05-27 10:23:53
LQ_CLOSE
56,324,254
How to get the "host" object java
<p>I need to get the "host" object of another object. Here an example</p> <p>Suppose I have the </p> <pre><code>class Peer { final Service service; public Peer(Service service) { this.service = service; } public void ping() { service.ping(); } } </code></pre> <p>and </p> <pre><code>class Service { public String hola() { this.getPeer()? //HERE I NEED SOME COMMAND TO GET the Peer object, is this possible? } } </code></pre> <p>Then in Service class, I need to get the peer object. Is this possible?</p>
<java>
2019-05-27 10:27:40
LQ_CLOSE
56,326,097
How to use backgroundworker with main thread functions?
I have some functions in my main thread, and I want to use them in the BackGroundWorker, the problem is that I can't reach to text boxes. I've seen many solutions but non of them worked. I've tried to implement some functions I've seen on web, unfortunately due to my newbie skills, can't apply them.. public void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) {Teste();} public void Teste() { tbtatual.Text = "12"; } My main problem is not do this, but if I can figure this out, I can implement the rest of my code. Thank you for reading fellows. Best regards and great coding!
<c#>
2019-05-27 12:29:03
LQ_EDIT
56,326,130
How to extract lower and upper bound in numeric format from a confidence interval string?
<p>Suppose a vector including some confidence intervals as below</p> <pre><code>confint &lt;- c("[0.741 ; 2.233]", "[263.917 ; 402.154]", "[12.788 ; 17.975]", "[0.680 ; 2.450]", "[0.650 ; 1.827]", "[0.719 ; 2.190]") </code></pre> <p>I want to have two new vectors one including the lower Limits in numeric format as </p> <pre><code>lower &lt;- c(0.741, 263.917, 12.788, 0.680, 0.650 , 0.719) </code></pre> <p>and othe including the upper Limits in numeric format like</p> <pre><code>upper &lt;- c(2.233, 402.154, 17.975, 2.450, 1.827, 2.190) </code></pre>
<r>
2019-05-27 12:31:16
HQ
56,326,437
How to change page heading in activeadmin
<p>I want to change the titles of page as shown in diagram below. <a href="https://i.stack.imgur.com/pryOB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pryOB.png" alt="enter image description here"></a></p> <p>How can I change that?</p>
<ruby-on-rails><ruby><activeadmin>
2019-05-27 12:48:07
LQ_CLOSE
56,326,847
Xcodebuild - Skip Finished requesting crash reports. Continuing with testing
<p>I'm running a CI machine with the Xcode.</p> <p>The tests are triggered using <code>fastlane gym</code>. I see this line in the output:</p> <blockquote> <p>2019-05-27 16:04:28.417 xcodebuild[54605:1482269] [MT] IDETestOperationsObserverDebug: (A72DBEA3-D13E-487E-9D04-5600243FF617) Finished requesting crash reports. Continuing with testing.</p> </blockquote> <p>This operation takes some time (about a minute) to complete. As far, as I understand, the Xcode requests crash reports from Apple to show in the "Organizer" window.</p> <p>Since this is a CI machine, the crash reports will never be viewed on it and this step could be skipped completely how can I skip it?</p>
<ios><xcode><xcodebuild><fastlane><fastlane-gym>
2019-05-27 13:15:02
HQ
56,327,404
How to enable .NET Core 3 preview SDK in VS2019?
<p>I wanted to try out Blazor. I've installed .NET Core 3.0 preview 5 SDK, Blazor VS extension to enable project templates. I can create Blazor project, but I can't run it - I constantly get this notification. <a href="https://i.stack.imgur.com/d3eBN.png" rel="noreferrer"><img src="https://i.stack.imgur.com/d3eBN.png" alt="enter image description here"></a></p> <p>In some tutorials I see that there should be a checkbox in VS options - to enable using of preview SDKs.</p> <p>But it's not there in VS2019! Version is 16.1.1</p> <p><a href="https://i.stack.imgur.com/TQST1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/TQST1.png" alt="enter image description here"></a></p>
<visual-studio-2019><blazor>
2019-05-27 13:51:39
HQ
56,328,775
NoSuchElementException, when method is called after code above it is run
<p>When I run my code, it will run fine up to the line "scanner.close()". After than, when I run the "SumTenNumbers()" method... it will run the first line of the while loop once and crash with the "NoSuchElementException"... When I remove the code above the line calling the method, it runs fine... Why does this occur, and how can I solve it?</p> <p>This is the code:</p> <pre><code>public class Main { public static void main(String[] args) { // we use the class "scanner" for input data Scanner scanner = new Scanner(System.in); //System.in allows you to type input data into the console which can be returned into the console System.out.println("Enter your name: "); String name = scanner.nextLine(); System.out.println("Your name is " + name); System.out.println("Enter your year of birth: "); boolean isInt = scanner.hasNextInt(); if (isInt) { int yearOfBirth = scanner.nextInt(); int age = 2019 - yearOfBirth; if (age &gt;= 0 &amp;&amp; age &lt;= 120) { System.out.println("You are " + age + " years old"); } else { System.out.println("Invalid year of birth"); } } else { System.out.println("Unable to parse year of birth"); } scanner.close(); // we must close scanner SumTenNumbers(); } public static void SumTenNumbers() { var reader = new Scanner(System.in); int sum = 0; int count = 1; while (count &lt; 11) { System.out.println("Enter number " + count + ": "); boolean valid = reader.hasNextInt(); if (valid) { int userNum = reader.nextInt(); sum += userNum; count++; } else { reader.next(); System.out.println("INVALID"); } } System.out.println(sum); reader.close(); } } </code></pre> <p>This is how it looks when I run the code...</p> <pre><code>Enter your name: Siddharth Your name is Siddharth Enter your year of birth: 2001 You are 18 years old Enter number 1: Exception in thread "main" java.util.NoSuchElementException at java.base/java.util.Scanner.throwFor(Scanner.java:937) at java.base/java.util.Scanner.next(Scanner.java:1478) at com.company.Main.SumTenNumbers(Main.java:64) at com.company.Main.main(Main.java:39) Process finished with exit code 1 </code></pre>
<java>
2019-05-27 15:21:44
LQ_CLOSE
56,329,093
Memory leaks when using pandas_udf and Parquet serialization?
<p>I am currently developing my first whole system using PySpark and I am running into some strange, memory-related issues. In one of the stages, I would like to resemble a Split-Apply-Combine strategy in order to modify a DataFrame. That is, I would like to apply a function to each of the groups defined by a given column and finally combine them all. Problem is, the function I want to apply is a prediction method for a fitted model that "speaks" the Pandas idiom, i.e., it is vectorized and takes a Pandas Series as an input. </p> <p>I have then designed an iterative strategy, traversing the groups and manually applying a pandas_udf.Scalar in order to solve the problem. The combination part is done using incremental calls to DataFrame.unionByName(). I have decided not to use the GroupedMap type of pandas_udf because the docs state that the memory should be managed by the user, and you should have special care whenever one of the groups might be too large to keep it in memory or be represented by a Pandas DataFrame.</p> <p>The main problem is that all the processing seems to run fine, but in the end I want to serialize the final DataFrame to a Parquet file. And it is at this point where I receive a lot of Java-like errors about DataFrameWriter, or out-of-memory exceptions.</p> <p>I have tried the code in both Windows and Linux machines. The only way I have managed to avoid the errors has been to increase the --driver-memory value in the machines. The minimum value is different in every platform, and is dependent on the size of the problem, which somehow makes me suspect on memory leaks.</p> <p>The problem did not happen until I started using pandas_udf. I think that there is probably a memory leak somewhere in the whole process of pyarrow serialization taking place under the hood when using a pandas_udf.</p> <p>I have created a minimal reproducible example. If I run this script directly using Python, it produces the error. Using spark-submit and increasing a lot the driver memory, it is possible to make it work. </p> <pre class="lang-py prettyprint-override"><code>import pyspark import pyspark.sql.functions as F import pyspark.sql.types as spktyp # Dummy pandas_udf ------------------------------------------------------------- @F.pandas_udf(spktyp.DoubleType()) def predict(x): return x + 100.0 # Initialization --------------------------------------------------------------- spark = pyspark.sql.SparkSession.builder.appName( "mre").master("local[3]").getOrCreate() sc = spark.sparkContext # Generate a dataframe --------------------------------------------------------- out_path = "out.parquet" z = 105 m = 750000 schema = spktyp.StructType( [spktyp.StructField("ID", spktyp.DoubleType(), True)] ) df = spark.createDataFrame( [(float(i),) for i in range(m)], schema ) for j in range(z): df = df.withColumn( f"N{j}", F.col("ID") + float(j) ) df = df.withColumn( "X", F.array( F.lit("A"), F.lit("B"), F.lit("C"), F.lit("D"), F.lit("E") ).getItem( (F.rand()*3).cast("int") ) ) # Set the column names for grouping, input and output -------------------------- group_col = "X" in_col = "N0" out_col = "EP" # Extract different group ids in grouping variable ----------------------------- rows = df.select(group_col).distinct().collect() groups = [row[group_col] for row in rows] print(f"Groups: {groups}") # Split and treat the first id ------------------------------------------------- first, *others = groups cur_df = df.filter(F.col(group_col) == first) result = cur_df.withColumn( out_col, predict(in_col) ) # Traverse the remaining group ids --------------------------------------------- for i, other in enumerate(others): cur_df = df.filter(F.col(group_col) == other) new_df = cur_df.withColumn( out_col, predict(in_col) ) # Incremental union -------------------------------------------------------- result = result.unionByName(new_df) # Save to disk ----------------------------------------------------------------- result.write.mode("overwrite").parquet(out_path) </code></pre> <p>Shockingly (at least for me), the problem seems to vanish if I put a call to repartition() just before the serialization statement.</p> <pre class="lang-py prettyprint-override"><code>result = result.repartition(result.rdd.getNumPartitions()) result.write.mode("overwrite").parquet(out_path) </code></pre> <p>Having put this line into place, I can lower a lot the driver memory configuration, and the script runs fine. I can barely understand the relationship among all those factors, although I suspect lazy evaluation of the code and pyarrow serialization might be related.</p> <p>This is the current environment I am using for development:</p> <pre><code>arrow-cpp 0.13.0 py36hee3af98_1 conda-forge asn1crypto 0.24.0 py36_1003 conda-forge astroid 2.2.5 py36_0 atomicwrites 1.3.0 py_0 conda-forge attrs 19.1.0 py_0 conda-forge blas 1.0 mkl boost-cpp 1.68.0 h6a4c333_1000 conda-forge brotli 1.0.7 he025d50_1000 conda-forge ca-certificates 2019.3.9 hecc5488_0 conda-forge certifi 2019.3.9 py36_0 conda-forge cffi 1.12.3 py36hb32ad35_0 conda-forge chardet 3.0.4 py36_1003 conda-forge colorama 0.4.1 py36_0 cryptography 2.6.1 py36hb32ad35_0 conda-forge dill 0.2.9 py36_0 docopt 0.6.2 py36_0 entrypoints 0.3 py36_0 falcon 1.4.1.post1 py36hfa6e2cd_1000 conda-forge fastavro 0.21.21 py36hfa6e2cd_0 conda-forge flake8 3.7.7 py36_0 future 0.17.1 py36_1000 conda-forge gflags 2.2.2 ha925a31_0 glog 0.3.5 h6538335_1 hug 2.5.2 py36hfa6e2cd_0 conda-forge icc_rt 2019.0.0 h0cc432a_1 idna 2.8 py36_1000 conda-forge intel-openmp 2019.3 203 isort 4.3.17 py36_0 lazy-object-proxy 1.3.1 py36hfa6e2cd_2 libboost 1.67.0 hd9e427e_4 libprotobuf 3.7.1 h1a1b453_0 conda-forge lz4-c 1.8.1.2 h2fa13f4_0 mccabe 0.6.1 py36_1 mkl 2018.0.3 1 mkl_fft 1.0.6 py36hdbbee80_0 mkl_random 1.0.1 py36h77b88f5_1 more-itertools 4.3.0 py36_1000 conda-forge ninabrlong 0.1.0 dev_0 &lt;develop&gt; nose 1.3.7 py36_1002 conda-forge nose-exclude 0.5.0 py_0 conda-forge numpy 1.15.0 py36h9fa60d3_0 numpy-base 1.15.0 py36h4a99626_0 openssl 1.1.1b hfa6e2cd_2 conda-forge pandas 0.23.3 py36h830ac7b_0 parquet-cpp 1.5.1 2 conda-forge pip 19.0.3 py36_0 pluggy 0.11.0 py_0 conda-forge progressbar2 3.38.0 py_1 conda-forge py 1.8.0 py_0 conda-forge py4j 0.10.7 py36_0 pyarrow 0.13.0 py36h8c67754_0 conda-forge pycodestyle 2.5.0 py36_0 pycparser 2.19 py36_1 conda-forge pyflakes 2.1.1 py36_0 pygam 0.8.0 py_0 conda-forge pylint 2.3.1 py36_0 pyopenssl 19.0.0 py36_0 conda-forge pyreadline 2.1 py36_1 pysocks 1.6.8 py36_1002 conda-forge pyspark 2.4.1 py_0 pytest 4.5.0 py36_0 conda-forge pytest-runner 4.4 py_0 conda-forge python 3.6.6 hea74fb7_0 python-dateutil 2.8.0 py36_0 python-hdfs 2.3.1 py_0 conda-forge python-mimeparse 1.6.0 py_1 conda-forge python-utils 2.3.0 py_1 conda-forge pytz 2019.1 py_0 re2 2019.04.01 vc14h6538335_0 [vc14] conda-forge requests 2.21.0 py36_1000 conda-forge requests-kerberos 0.12.0 py36_0 scikit-learn 0.20.1 py36hb854c30_0 scipy 1.1.0 py36hc28095f_0 setuptools 41.0.0 py36_0 six 1.12.0 py36_0 snappy 1.1.7 h777316e_3 sqlite 3.28.0 he774522_0 thrift-cpp 0.12.0 h59828bf_1002 conda-forge typed-ast 1.3.1 py36he774522_0 urllib3 1.24.2 py36_0 conda-forge vc 14.1 h0510ff6_4 vs2015_runtime 14.15.26706 h3a45250_0 wcwidth 0.1.7 py_1 conda-forge wheel 0.33.1 py36_0 win_inet_pton 1.1.0 py36_0 conda-forge wincertstore 0.2 py36h7fe50ca_0 winkerberos 0.7.0 py36_1 wrapt 1.11.1 py36he774522_0 xz 5.2.4 h2fa13f4_4 zlib 1.2.11 h62dcd97_3 zstd 1.3.3 hfe6a214_0 </code></pre> <p>Any hint or help would be much appreciated.</p>
<python><pandas><pyspark><pyspark-sql><pyarrow>
2019-05-27 15:45:01
HQ
56,332,750
Strange process while turning off my computer
<p>So I was on my way to turn off my computer when unexpectedly, in the screen where you see the programs that block Windows to turn off, i saw one process with a strange name like {4593-9493-8949-9390} (not the exact same name but similar) and before i could click on the cancel button the process close.</p> <p>My question here is if I should be wondering about that strange process or its just some random Windows 10 routine</p>
<windows><windows-10>
2019-05-27 21:47:58
LQ_CLOSE
56,332,907
SImple code runs correctly in DevC++ but not Virtual Studio Code
Code runs fine DevC++ but not Virtual studio Code Was doing a Homework question. Simple code adding two integers. Code looked fine but running it kept giving me the wrong result. After losing my mind I tried to run it in DevC++ to which it gave me the result I expected I'm very very new to coding. Virtual studio Code is trying to tell me something in the output window but I don't know what it's is trying to tell me. ```` #include <stdio.h> int main() { double x,y,z; printf("Enter first number:" ); scanf("%i", &x); printf("Enter second number:" ); scanf("%i", &y); printf("the first number is: %d \n",x); printf("the second number is: %d \n ",y); z= x+y; printf("Output 1: The result is %d . \n",z); printf("Output 2: The sum of %d and %d is %d . ",x,y,z); return 0; } ```` -------------------VS Code output Window------------------------- ```` hwidk.cpp:19:8: warning: format '%d' expects argument of type 'int', but argument 2 has type 'double' [-Wformat=] printf("Output 1: The result is %d . \n",z); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ [hwidk.cpp 2019-05-27 21:35:01.608] hwidk.cpp:20:8: warning: format '%d' expects argument of type 'int', but argument 2 has type 'double' [-Wformat=] printf("Output 2: The sum of %d and %d is %d . ",x,y,z); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ hwidk.cpp:20:8: warning: format '%d' expects argument of type 'int', but argument 3 has type 'double' [-Wformat=] [hwidk.cpp 2019-05-27 21:35:01.608] hwidk.cpp:20:8: warning: format '%d' expects argument of type 'int', but argument 4 has type 'double' [-Wformat=] ```` --------------Virtual Studio Runs the code as------------------------ ```` Enter first number:5 Enter second number:6 the first number is: 5 the second number is: 6 Output 1: The result is 7 . Output 2: The sum of 5 and 0 is 6 ````
<c++>
2019-05-27 22:05:33
LQ_EDIT
56,332,926
hwo can i run a "DELETE FROM TABLE" with jdbc in spark 2.4?
i'm using a code like this spark.read.format("jdbc").options(Map("url" -> "jdbc:url")) i need to use a DELETE FROM
<scala><apache-spark>
2019-05-27 22:09:16
LQ_EDIT
56,334,263
Why is my Jquery is not append in select option?
I try to append data in select option but it's not showing/append in it This is the select option <select class="form-control show-tick" style="font-size: 14px;" id="kode_kantor" name="office_code" data-live-search="true"> <option value="choose" disabled selected>-- choose office --</option> </select> This is the ajax code <script type="text/javascript"> $.ajax({ 'url': 'http://x.x.x.x/test/API/getOfficeBySearch', 'method': 'POST', 'data': { 'request': JSON.stringify({"username":"test","password":"test","searchparam":"type","searchvalue":"office"}) }, 'success': function(result) { result = JSON.parse(result) result.data.forEach(function(value, index) { var element = ` <option value="${value.officeid}">${value.name}</option> ` $('#office_code').append(element) }) } }) </script> ------------------------------------
<php><jquery><ajax>
2019-05-28 02:22:31
LQ_EDIT
56,334,426
transmission parameter into <?= ?>
i have list <?= total ?> length 7 and i want get element in list push array different. [error][1] i'm running google app script and page error "ReferenceError: "k" is not defined. (line 328, file "Code")" var tmp = []; for(var k = 0; k < <?= total.length ?> ; k ++){ tmp.push(<?= total[k] ?>); } [1]: https://i.stack.imgur.com/2zC7K.png
<javascript><html><google-apps-script>
2019-05-28 02:55:28
LQ_EDIT
56,335,388
Where to learn Tizen Native Wearable Basics
<p>I'm trying to develop an app for my Galaxy Watch which runs on Tizen. I'm not able to find any wholesome tutorial out there for Tizen. Do you mind recommending me some? </p> <p>Thanks</p>
<tizen><tizen-wearable-sdk><tizen-native-app>
2019-05-28 05:14:35
LQ_CLOSE
56,335,392
when i run this code i get error admin is not defined
how to retrieve user list from fire base authentication i want to retrieve all register user list how. when i using list user function then message is admin is not define. i am using this function function listAllUsers(nextPageToken) { admin.auth().listUsers(1000, nextPageToken) .then(function(listUsersResult) { listUsersResult.users.forEach(function(userRecord) { console.log('user', userRecord.toJSON()); }); if (listUsersResult.pageToken) { listAllUsers(listUsersResult.pageToken); } }) .catch(function(error) { console.log('Error listing users:', error); }); } i am using thsi code to get all user list from firebase auth but i can not get it. error will be admin is not define
<javascript><php><jquery><laravel><firebase>
2019-05-28 05:15:08
LQ_EDIT
56,336,101
Mongo DB - difference between standalone & 1-node replica set
<p>I needed to use Mongo DB transactions, and recently I understood that transactions don't work for Mongo standalone mode, but only for replica sets (<a href="https://stackoverflow.com/questions/56322333/mongo-db-with-c-sharp-document-added-regardless-of-transaction/56323934#56323934">Mongo DB with C# - document added regardless of transaction</a>).<br> Also, I read that standalone mode is not recommended for production.</p> <p>So I found out that simply defining a replica set name in the mongod.cfg is enough to run Mongo DB as a replica set instead of standalone.<br> After changing that, Mongo transactions started working.<br> However, it feels a bit strange using it as replica-set although I'm not really using the replication functionality, and I want to make sure I'm using a valid configuration.</p> <p>So my questions are:</p> <ol> <li>Is there any problem/disadvantage with running Mongo as a 1-node replica set, assuming I don't really need the replication, load balancing or any other scalable functionality? (as said I need it to allow transactions)</li> <li>What are the functionality and performance differences, if any, between running as standalone vs. running as a 1-node replica set?</li> <li>I've read that standalone mode is not recommended for production, although it sounds like it's the most basic configuration. I understand that this configuration is not used in most scenarios, but sometimes you may want to use it as a standard DB on a local machine. So why is standalone mode not recommended? Is it not stable enough, or other reasons?</li> </ol>
<mongodb><replicaset><mongodb-replica-set>
2019-05-28 06:21:47
HQ
56,336,302
i have an unidenified problem with my code
i am trying to fetch a json. while the code used to work i changed it a little and now it doesn't work. the code is supposed to exchange money. it's my first time posting so i really don't know what to do. i have almost zero experience. i am posting it because i need it for my school project. sendjsonrequest(); assert tv != null; //Request a string response from the URL resource StringRequest stringRequest = new StringRequest(Request.Method.GET, "https://free.currencyconverterapi.com/api/v6/convert?q=EUR_ILS&compact=ultra&apiKey=6f4b50fae0c5c91a84bd", new Response.Listener<String>() { @Override public void onResponse(String response) { // Display the response string. tv.setText("Response is: " + Float.parseFloat(response) * Float.parseFloat(et1.getText().toString())); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { tv.setText("Oops! That didn't work!"); } }); //Instantiate the RequestQueue and add the request to the queue RequestQueue queue = Volley.newRequestQueue(getApplicationContext()); queue.add(stringRequest); String str1 = et1.getText().toString(); str = Float.parseFloat(str1); float e = f * str; String ef = Float.toString(e); tv.setText(ef); } }); button = findViewById(R.id.button); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(Main2Activity.this, MainActivity.class); startActivity(intent); } }); } public void sendjsonrequest() {//sends the request to the website and retrieves specififc data (exchange rate between EUR to ILS) JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { try { tv1 = response.getString("EUR_ILS"); f = Float.parseFloat(tv1); } catch (JSONException e) { e.printStackTrace(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { } }); rq.add(jsonObjectRequest); } }
<android>
2019-05-28 06:37:54
LQ_EDIT
56,337,226
Build pipes with multiple async HTTP equest
I need to make first HTTP request and get from response array of object. Then I need to make HTTP request for every object in array (probably in loop) to get extra info. All this inside Angular7 -> I try with pipes but have some difficulties.
<angular><rxjs><angular-httpclient>
2019-05-28 07:39:06
LQ_EDIT
56,337,672
what is the c++ equivalent of map(int,input().split()) of python?
<p>I find it hard to do all the string manipulation and then parsing into an array of integers in c++ while we could get away with only a single line in python.</p> <p>whats the easiest way to split the string of integers into an array of integers in c++ ? </p>
<python><c++><string><c++14>
2019-05-28 08:06:18
LQ_CLOSE
56,337,869
Whats NDK (side-by-side) in android sdk?
<p>There's a ndk (side-by-side) at <a href="https://i.stack.imgur.com/UO8KE.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/UO8KE.jpg" alt="the sdk manager"></a>. Is it needed to install or just need to install the ndk? </p>
<android><android-ndk>
2019-05-28 08:18:39
HQ
56,341,103
on the click of the image it is not removing-Jquery
selecting the multiple image from the input tag after that i am previewing the selected image but when i click on that image it should delete from the input tag it does not select that picture anymore. but in my case that picture is removing only in preview not in input. And save it into database here is the code <?php include_once 'Functions.php'; $connect=new Connection(); $link=$connect->Connect(); print_r($_FILES['fil']['name']); ?> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <script> $(document).ready(function(){ var image=('') $('input[type="file"]'). change(function(e){ var fileName = e. target. files[0]. name; alert('The file "' + fileName + '" has been selected.' ); }); $(function() { var imagesPreview = function(input, placeToInsertImagePreview) { if (input.files) { var filesAmount = input.files.length; for (i = 0; i < filesAmount; i++) { var reader = new FileReader(); reader.onload = function(event) { $($.parseHTML('<img class="picture" width="70" name="multipic">')).attr('src', event.target.result).appendTo(placeToInsertImagePreview); $('.picture').click(function(){ $(this).remove(); }); } reader.readAsDataURL(input.files[i]); } } }; $('#gallery-photo-add').on('change', function() { imagesPreview(this,'div.gallery'); }); }); }); </script> </head> <body> <form name="update" enctype='multipart/form-data' method="POST"> <input type="file" name="fil[]" multiple id="gallery-photo-add" class="a1"> <div class="gallery"></div> <input type="submit" name="btnupdate" value="Update" /> </form> </body> </html>
<php><jquery>
2019-05-28 11:23:08
LQ_EDIT
56,342,360
Using Awk to find Unique cars bought by a customer
I have log files like this : Customer Car Bought FranΓ§ois Nissan Pajero 28/05/2016 Matthew Mercedes S 10/01/2019 Andrew Peugeot 508 05/0/2000 Matthew Toyota Hilux 02/10/2012 I need to make an awk script which display for each customer what car he has bought like this : Matthew, car bought: Mercedes S,Toyota Hilux, number of cars: 2 Francois, car bought: Nissan Pjero, number of cars: 1 I tried various things but wasnt able to do it.
<awk>
2019-05-28 12:31:35
LQ_EDIT
56,342,760
How to remove " " from text using regex-Python 3
<p>So, I have a text string that I want to remove the "" from.</p> <p><strong>Here is my text string:</strong></p> <pre><code>string= 'Sample this is a string text with "ut" ' </code></pre> <p><strong>Here is the output I want once using a regex expression:</strong></p> <pre><code>string= 'Sample this is a string text with ut' </code></pre> <p><strong>Here is my overall code:</strong> </p> <pre><code>import re string= 'Sample this is a string text with "ut" ' re.sub('" "', '', string) </code></pre> <p>And the output just show the exact text in the string without any changes. Any suggestions?</p>
<python><regex><python-3.x>
2019-05-28 12:53:47
LQ_CLOSE
56,343,003
Terms in neural networks
I’m reading a paper about sound separation by using neural network method and I have problems with some terms on it I hope you guys can help in definitions, Here is the question what is the effect of annealing the temperature parameter in a softmax activation function?
<python><neural-network><artificial-intelligence><softmax>
2019-05-28 13:08:09
LQ_EDIT
56,343,389
How to convert json array to json objects
I need to convert a JSON array to JSON objects by id as key for every object in javascript. What I have: [{ "author" : "aaaa", "catid" : 22, "id" : 23, "name" : "Book a", "size" : 56658 }, { "author" : "bbbb", "catid" : 22, "id" : 24, "logo" : "logo", "name" : "Book b", "size" : 73386 }, { "author" : "cccc", "catid" : 22, "id" : 25, "logo" : "logo", "name" : "Book c", "size" : 84777 }, { "author" : "ddd", "catid" : 22, "id" : 26, "logo" : "logo", "name" : "Book d", "size" : 105139 }] What I need: { "23":{ "author" : "aaaa", "catid" : 22, "name" : "Book a", "size" : 56658 }, "24":{ "author" : "bbbb", "catid" : 22, "logo" : "logo", "name" : "Book b", "size" : 73386 }, "25":{ "author" : "cccc", "catid" : 22, "logo" : "logo", "name" : "Book c", "size" : 84777 }, "26":{ "author" : "ddd", "catid" : 22, "logo" : "logo", "name" : "Book d", "size" : 105139 }}
<javascript>
2019-05-28 13:29:31
LQ_EDIT
56,345,629
Does Go have exceptions during overflow for arythmetic operations
I ma just porting some Go code to Rust and I realized that when Rust rise overflow during multiplication exception Go just allow overflow to happen. Test code below, that does not cause overflow but print reduced value. (tested via: https://play.golang.org/) ``` func main() { fmt.Println("test\n") var key uint64 = 15000; key = key*2862933555777941757 + 1 fmt.Println(key) } ``` Is that expected behavior? Sorry for basic question but I don't have much Go Experience.
<go><integer-overflow>
2019-05-28 15:34:03
LQ_EDIT
56,348,601
How to parse a requested parameter String to a double (or self-made class)?
<p>So as part of an add form to a database I request a parameter form the form by the id (request.getParameter("idOfInput"), this gives me a String but the input is a price. I have to parse this input into a double and pass it on to my setPrice() method. However when I parse it I get a NullPointerException saying there is a Floating Decimal. How do I pass on my paremeter correctly? Also I have class named Category and I want to do the same for that.</p> <pre><code>private void setPrice(Bike bike, HttpServletRequest request, ArrayList&lt;String&gt; errors){ String priceS = request.getParameter("price"); double price = Double.parseDouble(priceS); try{ bike.setPrice(price); } catch (DomainException e){ errors.add(e.getMessage()); } } </code></pre>
<java><jsp><selenium-chromedriver><jstl>
2019-05-28 19:04:20
LQ_CLOSE
56,349,260
Why is scanf executed before printf in eclipse?
<p>While i execute any program in Eclipse C, Scanf stmt is execured first and then at the end of execution of program all printf stmts are printed on the console. How to fix this problem in eclipse 2.0 oxygen.</p>
<c><eclipse><compiler-errors><printf><scanf>
2019-05-28 19:56:33
LQ_CLOSE
56,351,072
How do i alter my Current code to read directly from the IDR register
<p>Modify the code for <strong>ReadJoystick()</strong> to read the <strong>IDR register</strong> directly for the ports associated with the joystick inputs. The aim is to minimise the number of reads to the register. The code in the template makes an individual call for each of the inputs pins, even though some of the pins are on the same ports. You can refer to the HAL code for inspiration. Use the defined values in the HAL for addressing registers rather than creating new ones.</p> <p>Example Code Given to Me</p> <pre><code>GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) { GPIO_PinState bitstatus; /* Check the parameters */ assert_param(IS_GPIO_PIN(GPIO_Pin)); if ((GPIOx-&gt;IDR &amp; GPIO_Pin) != (uint32_t)GPIO_PIN_RESET) { bitstatus = GPIO_PIN_SET; } else { bitstatus = GPIO_PIN_RESET; } return bitstatus; </code></pre> <p>}</p> <hr> <p><strong>Code I require to Alter</strong></p> <p>// REPLACE THE FOLLOW CODE WITH YOUR SOLUTION </p> <pre><code>uint8_t ReadJoystick () { uint8_t JoystickPosition = 0; // Get current joystick value if (HAL_GPIO_ReadPin (JOY_A_GPIO_Port, JOY_A_Pin) == GPIO_PIN_RESET) { JoystickPosition = 'L'; } else if (HAL_GPIO_ReadPin (JOY_B_GPIO_Port, JOY_B_Pin) == GPIO_PIN_RESET) { JoystickPosition = 'U'; } else if (HAL_GPIO_ReadPin (JOY_C_GPIO_Port, JOY_C_Pin) == GPIO_PIN_RESET) { JoystickPosition = 'D'; } else if (HAL_GPIO_ReadPin (JOY_D_GPIO_Port, JOY_D_Pin) == GPIO_PIN_RESET) { JoystickPosition = 'R'; } else if (HAL_GPIO_ReadPin (JOY_CTR_GPIO_Port, JOY_CTR_Pin) == GPIO_PIN_RESET) { JoystickPosition = 'C'; } return JoystickPosition; } </code></pre> <p>So I Understand that my current code is reading each pin although i've been asked to alter this to read directly from the IDR register. I'm really new to embedded systems programming and just looking for someone to guide me with altering this code</p>
<c><embedded><stm32><gpio>
2019-05-28 23:01:46
LQ_CLOSE
56,351,488
How to get the value of one of the key-value pairs of JSON in Javascrpt?
I want to get the value of gid in Javascrpt alert($.parseJSON(data); √ alert($.parseJSON(data['responseJSON'].gid)); Γ— alert($.parseJSON(data['responseJSON']['gid'])); Γ— I tried to use it like this but I got an error. I found a lot of answers but still can't get the value I need. {"form":{},"files":[{}],"filenames":["timg.jpg"],"filescount":1,"extra":{},"response":{"success":true,"msg":"image url after upload","gid":81},"reader":{},"jqXHR":{"readyState":4,"responseText":"{\"success\":true,\"msg\":\"image url after upload\",\"gid\":81}","responseJSON":{"success":true,"msg":"image url after upload","gid":81},"status":200,"statusText":"OK"}} alert($.parseJSON(data)); I want to get the value of gid (81),but it is not use.
<javascript><jquery>
2019-05-29 00:05:29
LQ_EDIT
56,351,710
sql exeption was not handled by user code
if (Page.IsValid) { DataSet.UsersDataTable oUserDataTable = new DataSet.UsersDataTable(); DataSetTableAdapters.UsersTableAdapter oUserTableAdapter = new DataSetTableAdapters.UsersTableAdapter(); oUserTableAdapter.FillUserByUserName(oUserDataTable, txtUserName.Text); if (oUserDataTable.Count!=1) { string strErrorMessage = "UserName Or Password Is Not Correct ! Please Try Again . . . "; DisplayErrorMessage(strErrorMessage); return; } DataSet.UsersRow oUserRow = oUserDataTable[0]; if (string.Compare(oUserRow.Password.Trim(),txtPassword.Text.Trim(),false)!=0) { string strErrorMessage = "UserName Or Password Is Not Correct ! Please Try Again . . . "; DisplayErrorMessage(strErrorMessage); return; } if (oUserRow.IsUserActive==false) { string strInformationMessage = string.Format("Dear {0} You Should Not Login At This Time , Please Contact Support",txtUserName.Text); DisplayInformationMessage(strInformationMessage); return; } Additional information: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
<c#><sql>
2019-05-29 00:47:40
LQ_EDIT
56,353,355
COnvert it to laravel
Need to convert this sql code to laravel SELECT b.name FROM brands b INNER JOIN products p on b.id=p.brand_id INNER JOIN transaction_sell_lines tr on p.brand_id=tr.product_id SELECT b.name FROM brands b INNER JOIN products p on b.id=p.brand_id INNER JOIN transaction_sell_lines tr on p.brand_id=tr.product_id Need to get the laravel code
<mysql><laravel><laravel-query-builder>
2019-05-29 04:58:57
LQ_EDIT
56,353,575
convert month name to number in unix
Input : 01-DEC-18|"0308"|"RUB" 01-DEC-18|"0308"|"RUB" 01-DEC-18|"0308"|"RUB" 01-DEC-18|"0308"|"RUB" Expected output : 01-12-18|"0308"|"RUB" 01-12-18|"0308"|"RUB" 01-12-18|"0308"|"RUB" 01-12-18|"0308"|"RUB"
<shell><unix>
2019-05-29 05:21:47
LQ_EDIT
56,354,079
npm build gives "Ineffective mark-compacts near heap limit Allocation failed"
<p>I have a reactjs/typescript project, running on windows 10. Im trying to build by ts-scripts with</p> <blockquote> <p>"rimraf ../wwwroot/* &amp;&amp; react-scripts-ts build &amp;&amp; copyfiles ./build/**/* ../wwwroot/ -u 1</p> </blockquote> <p>This has worked ok before, but when I removed the node_modules-folder, re-run the npm install-command and then the command above I get the error message</p> <blockquote> <p>FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory</p> </blockquote> <p>I have no idea why. After googling Ive seen</p> <blockquote> <p>NODE_OPTIONS="–max-old-space-size=2048" but I dont know where to put this</p> </blockquote> <p><strong>Full error message</strong></p> <p>Last few GCs </p> <pre><code>[11376:0000024682F49880] 60039 ms: Mark-sweep 2034.1 (2085.2) -&gt; 2033.7 (2085.2) MB, 1029.4 / 0.0 ms (average mu = 0.073, current mu = 0.006) allocation failure scavenge might not succeed [11376:0000024682F49880] 61094 ms: Mark-sweep 2034.4 (2085.2) -&gt; 2034.1 (2085.7) MB, 1047.7 / 0.0 ms (average mu = 0.039, current mu = 0.007) allocation failure scavenge might not succeed JS stacktrace ==== JS stack trace ========================================= 0: ExitFrame [pc: 000001CDF84DC5C1] Security context: 0x007044b9e6e1 &lt;JSObject&gt; 1: bindChildrenWorker(aka bindChildrenWorker) [000001AD1C0ACD59] [C:\Users\robcar\source\repos\Boost\Boost.Web\ClientApp\node_modules\typescript\lib\typescript.js:~27657] [pc=000001CDF8FA47CA](this=0x03da79d826f1 &lt;undefined&gt;,node=0x034b8724ab71 &lt;NodeObject map = 000000660468F931&gt;) 2: bind(aka bind) [000001AD1C0AE2D9] [C:\Users\robcar\source\repos\B... FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 1: 00007FF6B5EA121A v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4810 2: 00007FF6B5E7A5B6 node::MakeCallback+4518 3: 00007FF6B5E7AFA0 node_module_register+2160 4: 00007FF6B610B3EE v8::internal::FatalProcessOutOfMemory+846 5: 00007FF6B610B31F v8::internal::FatalProcessOutOfMemory+639 6: 00007FF6B6649304 v8::internal::Heap::MaxHeapGrowingFactor+11476 7: 00007FF6B663FA67 v8::internal::ScavengeJob::operator=+25543 8: 00007FF6B663DFDC v8::internal::ScavengeJob::operator=+18748 9: 00007FF6B6646F57 v8::internal::Heap::MaxHeapGrowingFactor+2343 10: 00007FF6B6646FD6 v8::internal::Heap::MaxHeapGrowingFactor+2470 11: 00007FF6B61E9DD7 v8::internal::Factory::NewFillerObject+55 12: 00007FF6B6281ABA v8::internal::WasmJs::Install+29530 13: 000001CDF84DC5C1 </code></pre>
<node.js><reactjs><typescript><npm>
2019-05-29 06:07:45
HQ
56,354,434
error: variable veryFar might not have been initialized, (using BigInteger Please help fix this
I am making a converter which will convert numbers to text.I did everything as said in this [website](https://developer360.net/java-program-convert-number-to-words-android-studio/) and edited for using big Integers but it is then showing a variable is not intialized I edited some things to make it compatible with big integers for bigger numbers, but it just shows variable veryFar maybe not initialized.(I edited the variable name to try fix it!) This is my MainActivity.java ```java package com.example.convertnumbertotext; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Switch; import android.widget.TextView; import android.widget.Toast; import java.math.BigInteger; import java.text.DecimalFormat; public class MainActivity extends AppCompatActivity { EditText etnum; Button btncon; TextView tvdisplay; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); etnum = (EditText) findViewById(R.id.etnum); btncon = (Button) findViewById(R.id.btncon); tvdisplay = (TextView) findViewById(R.id.tvdisplay); btncon.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { BigInteger numberToConvert = new BigInteger(etnum.getText().toString()); String return_val_in_english = EnglishNumberToWords.convert(numberToConvert); Toast.makeText(MainActivity.this,"Ammount "+" "+ return_val_in_english.toString(), Toast.LENGTH_LONG).show(); tvdisplay.setText(return_val_in_english); } }); } } ``` This is my XML file ```xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="15dp" tools:context=".MainActivity"> <TextView android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:layout_marginEnd="8dp" android:layout_marginBottom="8dp" android:text="Number:" android:textSize="30dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.0" /> <EditText android:id="@+id/etnum" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:layout_marginRight="8dp" android:layout_marginBottom="8dp" android:inputType="number" android:textSize="37dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.241" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.072" /> <Button android:id="@+id/btncon" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:layout_marginEnd="8dp" android:layout_marginBottom="8dp" android:text="convert" android:textSize="35dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.229" /> <TextView android:id="@+id/tvdisplay" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:layout_marginEnd="8dp" android:layout_marginBottom="8dp" android:textSize="40dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.793" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.499" /> </android.support.constraint.ConstraintLayout> ``` and this is my separate class (It is the one showing errors ```java package com.example.convertnumbertotext; import java.math.BigInteger; import java.text.DecimalFormat; public class EnglishNumberToWords { private static BigInteger bi = new BigInteger("100"); private static BigInteger bi2 = new BigInteger("20"); private static BigInteger bi3 = new BigInteger("10"); private static final String[] tensNames = { "", " ten", " twenty", " thirty", " forty", " fifty", " sixty", " seventy", " eighty", " ninety" }; private static final String[] numNames = { "", " one", " two", " three", " four", " five", " six", " seven", " eight", " nine", " ten", " eleven", " twelve", " thirteen", " fourteen", " fifteen", " sixteen", " seventeen", " eighteen", " nineteen" }; private static String convertLessThanOneThousand(BigInteger number) { String veryFar; BigInteger[] bii = number.divideAndRemainder(bi); BigInteger[] bii2 = number.divideAndRemainder(bi3); int resut = bii[1].compareTo(bi2); if (resut == -1) { veryFar = numNames[bii[1].intValue()]; number = number.divide(bi); } else if (resut == 1 || resut == 0) { veryFar = numNames[bii2[1].intValue()]; number = number.divide(bi3); veryFar = tensNames[bii2[1].intValue()] + veryFar; number = number.divide(bi3); } if (number.compareTo(BigInteger.valueOf(0)) == 0) return veryFar; return numNames[number.intValue()] + " hundred" + veryFar; } public static String convert (BigInteger number){ // 0 to 999 999 999 999 if (number.compareTo(BigInteger.valueOf(0)) == 0) { return "zero"; } String snumber = number.toString(); // pad with "0" String mask = "000000000000"; DecimalFormat df = new DecimalFormat(mask); snumber = df.format(number); BigInteger trillions = new BigInteger(snumber.substring(0, 3)); // nnnXXXnnnnnnnnn BigInteger billions = new BigInteger(snumber.substring(3, 6)); // nnnnnnXXXnnnnnn BigInteger millions = new BigInteger(snumber.substring(6, 9)); // nnnnnnnnnXXXnnn BigInteger hundredThousands = new BigInteger(snumber.substring(9, 12)); // nnnnnnnnnnnnXXX BigInteger thousands = new BigInteger(snumber.substring(12, 15)); String tradTrillions; if (trillions.compareTo(BigInteger.valueOf(0)) == 0) { tradTrillions = ""; } else if (trillions.compareTo(BigInteger.valueOf(1)) == 0) { tradTrillions = convertLessThanOneThousand(trillions) + " trillion "; } else { tradTrillions = convertLessThanOneThousand(trillions) + " trillion "; } String result = tradTrillions; String tradBillions; if (billions.compareTo(BigInteger.valueOf(0)) == 0) { tradBillions = ""; } else if (billions.compareTo(BigInteger.valueOf(1)) == 0) { tradBillions = convertLessThanOneThousand(billions) + " billion "; } else { tradBillions = convertLessThanOneThousand(billions) + " billion "; } result = result + tradBillions; String tradMillions; if (millions.compareTo(BigInteger.valueOf(0)) == 0) { tradMillions = ""; } else if (millions.compareTo(BigInteger.valueOf(1)) == 0) { tradMillions = convertLessThanOneThousand(millions) + " million "; } else { tradMillions = convertLessThanOneThousand(millions) + " million "; } result = result + tradMillions; String tradHundredThousands; if (hundredThousands.compareTo(BigInteger.valueOf(0)) == 0) { tradHundredThousands = ""; } else if (hundredThousands.compareTo(BigInteger.valueOf(1)) == 0) { tradHundredThousands = "one thousand "; } else { tradHundredThousands = convertLessThanOneThousand(hundredThousands) + " thousand "; } result = result + tradHundredThousands; String tradThousand; tradThousand = convertLessThanOneThousand(thousands); result = result + tradThousand; // remove extra spaces! return result.replaceAll("^\\s+", "").replaceAll("\\b\\s{2,}\\b", " "); } } ``` It shows 2 same error messages- error: variable veryFar might not have been initialized error: variable veryFar might not have been initialized Please Help
<java><android>
2019-05-29 06:35:57
LQ_EDIT
56,355,499
Stop angular cli asking for collecting analytics when I use ng build
<p>Angluar CLI is asking the following question when I am trying to build and deploy my project using gitlab CI/CD:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&gt; @angular/cli@8.0.0 postinstall /workspace/node_modules/@angular/cli &gt; node ./bin/postinstall/script.js ? Would you like to share anonymous usage data with the Angular Team at Google u nder Google’s Privacy Policy at https://policies.google.com/privacy? For more details and how to change this setting, see http://angular.io/analytics. (y/N) </code></pre> </div> </div> </p> <p>Of course I cannot input anything in the CI/CD pipeline. How can I can prevent angular cli from asking this question?</p>
<angular><angular-cli>
2019-05-29 07:48:17
HQ
56,355,959
Add/remove class to element with delay if mouse is still over
I am opening my submenu with adding a class("reveal") to it's parent. What i want to achieve is when i hover over a parent, if no "active" hover is going on, to open the submenu immediately, but if a submenu is already shown, then wait 1second before it opens a new one. I want this because of "bad" mouse movement for it to wait in case the mouse leaves the submenu/parent to see if it re-enters in 1second. I know there are a bunch of similar threads, but i already did my attempt and can't se eright now what im doing wrong: $('.menu > li').hover(function(){ var ele = $(this); if($('.menu li.reveal').length > 0){ var t = setTimeout(function(){ if( ele.hover() ){ $('.menu li.reveal').removeClass('reveal'); ele.addClass('reveal'); } },1000); } else{ ele.addClass('reveal'); } });
<javascript><jquery><jquery-hover>
2019-05-29 08:15:43
LQ_EDIT