input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Awk : does not report error for 202D, 203B etc, it accepts one alpha character <p>I need to find out whether a field in a pipe delimited file is a numeric or not.
I need to report if the field is not a numeric field, ignore if it is numeric
and also ignore if it is null.
I have other computations.</p>
<p>I wrote this... | <p>Change the pattern to:</p>
<pre><code>/^([+-]|[0-9])[0-9]*([.][0-9]*)$|^([+-]|[0-9])[0-9]*$|^$/
</code></pre>
<p>The unprotected "." was matching the "B".</p>
|
How does the Firebase help on firing tags in google tag management <p>I am trying to understand what is the role of firebase to the google tag management.</p>
<p>According to the GTM document <a href="https://developers.google.com/tag-manager/android/v5/#log-events-and-variables" rel="nofollow">Log events and variable... | <p>Google Tag Manager's (GTM) mobile SDK relies on events from Firebase Analytics. Firebase Analytics provides some <a href="https://support.google.com/firebase/answer/6317485" rel="nofollow">Automatically Collected Events</a> that will be available for use as triggers in when firing tags.</p>
<p>You are also able to ... |
Does Dynamic Azure Service App support slots for swapping <p>I have an issue on what Service Plan to choose for some Azure Functions I want to build.
I tried to use the Dynamic plan on West Europe but looking into the portal it doesn't support slots. So although a Dynamic Plan would be great for scaling out I am conce... | <p>Slots are not currently supported in Azure Functions for either Dynamic or Classic service plans. The feature has not been completely disabled yet, but you should expect that certain things will not work correctly if you create a slot and try to do a swap.</p>
<p>To answer your other question, choosing a classic ap... |
Fill textboxes with data from database multiple columns with datareader <p>I'm new to the database stuff, but want to fill textboxes with data with an datareader and sql query.
My program creates 4 textboxes from every ship in my database. Each textbox needs to be filled with data from a different column. When the 4 te... | <p>Use this code, you were never assigning value to <code><input type='text'</code> tag being generated:</p>
<pre><code>public void Schip()
{
using (SqlConnection thisConnection = new SqlConnection("Data Source=VMB-LP12;Initial Catalog=SmmsData;Integrated Security=True"))
{
string oString = "Sel... |
copying columns from one workbook to another <p>I am encountering </p>
<blockquote>
<p>run time error 9</p>
<p>subscript out of range</p>
</blockquote>
<p>Here is my code:</p>
<pre><code>Sub copydatatocreatereport()
Dim report As Workbook
Dim datafile As Variant
'report is the active workbook where I want d... | <p>You need to set <code>datafile</code> as workbook (to the workbook you are trying to open).</p>
<p>You need to set <code>report</code> to <code>ActiveWorkbook</code> (not recommended, better to use <code>ThisWorkbook</code> , where the code lies, or a specific workbook).</p>
<p>You can't paste Entire Column to a s... |
Is there a way to perform a validation on the number of digits in a number? Laravel <p>I'm trying to validate a CAB code of a bank.</p>
<p>The rules are that the CAB it MUST be numeric, and composed by 5 digits.
I'm trying to validate this into a <strong>FormRequest</strong> class in Laravel 5.3</p>
<p>I've tried to ... | <p>Try <code>digits:value</code> or <code>digits_between:min,max</code></p>
|
What should i use instead of stmt.executeUpdate()? <p>when I use stmt.executeUpdate() and if I use executeQuery it wont return the record I just inserted into the db i did set coccurency and type while creating the stmt object</p>
<p>my tables are</p>
<pre><code>create Table Customer(
Customer_ID int,
Age int,
Contac... | <p>Replace</p>
<pre><code>ResultSet set = st.executeQuery("select Customer_ID from Customer where First_Name = '"+first+"' and last ='"+last+"' and contact_no ='"+contact_no+")");
ResultSet set = st.executeQuery("select Customer_ID from Customer where First_Name = '"+first+"' and last ='"+last+"' and contact_no ='"+c... |
mysql connection whitespace after user flag <p>I have a question, What is the significance of the <strong>whitespace</strong> after the user flag <code>-u</code> inside a mysql connection string?</p>
<pre><code>mysql -u myname -pmypass mydb
</code></pre>
<p>I mean to say, the above command works just fine, if I don't... | <p>The <code>-p</code> option takes an optional argument:</p>
<pre><code>mysql --help --verbose
...
-p, --password[=name]
Password to use when connecting to server. If password is
not given it's asked from the tty.
</code></pre>
<p>So, a command line that contains:</p>
<pre><code>-p mydb
</code></pre>
<p>woul... |
dynamically read xml element and value in java <p>I'm trying to read XML(whatever, i don't know it's structure, bcz i'm reading flie from server.), and i searched a lot on SO. but not found anything helpful.</p>
<p>1> i want to retrieve XML's node name, starting from root to end of file, child or child of child untill... | <p>You could use a StAX parser for this purpose.</p>
<h3>XML sample <code>employees.xml</code></h3>
<pre class="lang-xml prettyprint-override"><code><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<employees count="4">
<employee>
<id>2</id>
<firstName>Ja... |
Alfresco, query with dynamic values <p>I have a <code>Map</code> with different values:</p>
<pre><code> props = new HashMap<String, Object>();
props.put("cmis:objectTypeId", "D:ruc:PLICO");
props.put("cmis:name", "PLICO_1.pdf");
props.put("cmis:description", "Descr");
props.put("ruc:doc_surnam... | <p>My solution, but maybe somebody know how to improve it without dynamically build the query string:</p>
<pre><code> StringBuilder query = new StringBuilder("SELECT * FROM ? where ");
String folder = null;
if (path!=null)
{
folder = findPath(path);
if (folder==nu... |
Range filter gives values out of range <p>I have got a problem with my query :
I recive hits with StarDate out of filter range, for e.q 2016-09-07 ...</p>
<pre><code> "query" :{
"bool" : {
"must" : {
"range": {
"StartDate" : {
"gte" : "2016-09-18 00:18:32"
}
}
},
"m... | <p>Your second <code>must</code> clause overrides the first one with the constraint on <code>StartDate</code>, and hence only the <code>query_string</code> query kicks in. You need to write your query like this instead:</p>
<pre><code>{
"query": {
"bool": {
"must": [
{
"range": {
... |
blank cell checking to avoid null pointer exception <p>My excel sheet is as follows:</p>
<pre><code>Property_id Property_Name
3 Hilton
Season_start_date Season_end_date MSG Sun Mon Tues Wed Thurs Fri Sat
9/16/1999 9/16/1999 fx... | <p>I dont know why you wanted to throw exception whenever you encountered blank cell. I guess your problem might be solved if you ignored blank cells. </p>
<pre><code>switch (cell.getCellType()) {
case Cell.CELL_TYPE_NUMERIC:
System.out.print(cell.getNumericCellValue() + "\t");
... |
How to minimize cookie size in TYPO3? <p>When executing the chrome dev tool audit for my TYPO3 site, Chrome gives the following warning:</p>
<blockquote>
<p><strong>Minimize cookie size</strong><br>
The average cookie size for all requests on this page is 40âB</p>
</blockquote>
<p>Is there a way to reduce cooki... | <p>No, you cannot reduce the cookie size since the TYPO3 <code>fe_typo_user</code> cookie by default only includes the session ID. You can't get that any smaller.</p>
<p>What you could do is referencing the assets (images, css, javascript) from a different domain (<code>assets.example.org</code>). The TYPO3 cookie wil... |
Get number value from HTML element using JavaScript <p>How can I get a number value from inside the HTML element, which I would later use in the countdown? I keep getting error that document.getElementById(...) is null, am I missing something with concatenation? Here's the fiddle: <a href="https://jsfiddle.net/L6ddLc0L... | <p>You badly use parseInt(). You must call it this way.</p>
<pre><code>var secs = parseInt(num,10);
</code></pre>
<p>also take a look <a href="http://www.w3schools.com/js/js_whereto.asp" rel="nofollow">here</a> how your code in html should looks</p>
|
Java: ArrayIndexOutOfBoundException when searching for an Integer value in an Array <p>If i am looking for a certain value (needle) in an arrary and the value doens't exit in this array I am getting an java.lang.ArrayIndexOutOfBoundsException. (see Code below)
If the value exists in the array it works just fine.</p>
<... | <p>Arrays in Java are zero based (Java ain't Fortran you know): <code>array[0]</code> <em>is</em> valid for an non-zero length array.</p>
<p>Change the fist part of your stopping condition to <code>i < array.length</code>.</p>
|
special character in php array and then insert into excel using phpexcel <p>I need to put in the small "TM" in php array and then insert into excel file using phpexcel. However, the excel generated shows the cell as "FALSE" and not "ABC⢠1". May I know how can I put in the small "TM" in php array and pass it into exc... | <p>This is probably an encoding issue.</p>
<p>It is highly recommended that you make 100% sure you're <a href="http://www.phptherightway.com/#php_and_utf8" rel="nofollow">using UTF-8 with PHP</a>, for all steps of the production. This will save you a lot of headaches in the long run.</p>
<p>However, some applications... |
Get BaseType from object in Xamarin.Forms <p>I'm trying to find out if the <code>object</code> I have is of type <code>Page</code>. If I ask for <code>GetType()</code> I get <code>ContentPage</code>, which is a subclass of <code>TemplatedPage</code>, which is a subclass of <code>Page</code> (which again is a subclass o... | <p>You should just be able to check that out with the <a href="https://msdn.microsoft.com/nl-nl/library/scekt9xw.aspx" rel="nofollow">is keyword</a>. That will take care of the hard work for you.</p>
<p>So like: <code>if (parentElement is Page) { DoStuffHere(); }</code></p>
|
Disable blueprint routes sails js <p>Hello I have model users, in which there is a foreign key of Orders model.
Now sails will automatically generate route <code>/users/:id/orders</code>. I have to disable this route. How to do this ? I have already tried to disable all routes of orders using: <code>_config : { actions... | <p>You can achieve this by adding custom routes, which will overwrite the blueprint action.</p>
<p>Use <a href="http://sailsjs.org/documentation/concepts/routes/custom-routes#?response-target-syntax" rel="nofollow">http://sailsjs.org/documentation/concepts/routes/custom-routes#?response-target-syntax</a></p>
<pre><co... |
Diagram on a web page with Changing Values <p>I am trying to create a diagram which will display the IOPS between a hypervisor and a SAN on a web page (c# mvc web application), to show how much data transfer activity there is on a monitoring system.</p>
<p>For example something like this, however in this example the I... | <p>My suggestion is looking at drawing the diagram out in SVG. Something like <a href="https://inkscape.org/en/" rel="nofollow">Inkscape</a> should do just fine. It is free and open source.</p>
<p>You are able to add IDs and classes onto the elements in there as well so that you can access them in the standard JQuery ... |
Can this be XSS-ed? <p>EDIT: My question wasn't how to prevent XSS as I already know how to, but it was if a user can bypass the double-quotes removal. Thank you though :)</p>
<p>Is this vulnerable to XSS:</p>
<pre><code><img src="" alt="<?php echo str_replace('"', '', $_POST['imageDescription']);?>" title="... | <p>Yes, it's still vulnerable to XSS. There exists many techniques that can foil this, and granted a whole lot I don't know about. One thing I'm fairly certain can be abused to circumvent this, is by sending invalid UTF-8. Which, when run through your code (or by other means) is then transformed to a valid " character.... |
Extract a file from war file that is present inside ear file <p>I want to extract a particular file that is there in the following structure.</p>
<p>TestApp.ear/TestApp.war/WEB-INF/web.xml</p>
<p>Is there any way we can extract web.xml alone using unix command?</p>
<p>Thanks,
Vivek</p>
| <p>The <code>jar</code> command should work with <code>ear</code>, <code>war</code> and <code>jar</code></p>
<p>If you know the absolute path for your file to be extracted, you can use</p>
<pre><code>jar xf jar_file.jar <name_of_file_to_extract>
jar xvf file.ear path/to/file/file.abc
</code></pre>
|
Codeception, define another name for directory "tests" in bootstrap command <p>i need to use another name for the directory, codeception holds the test suites in. My original problem is, that I am working on windows and must maintain a project, where there are already PHPUnit tests in a directory called "Tests".
Now I ... | <p>Change <code>paths: tests:</code> setting as documented in <a href="http://codeception.com/docs/reference/Configuration" rel="nofollow">http://codeception.com/docs/reference/Configuration</a></p>
<p><code>
paths:
# where the modules stored
tests: codeception-tests
</code></p>
|
How to send two emails after checkout? <p>everyone! Please help me. I'm using Magento to configure a virtual store and, apart from the default email that is sent when an order is placed, I need a second additional email to be sent to the same customer, with only instructions. I need both emails being sent at the same t... | <p>If you are not interested in coding and if the two mails are not related then you can simply create a new Transactional Email(merging content from both emails) by navigating to <code>System -> Transactional Email</code> and then creating a new template from using load template for existing order template.</p>
<p... |
SSH tunnel from Python is too slow to connect <p>I'm connecting to a remote SQL database over SSH. If I set up the SSH connection from the Linux command line (using <code>ssh-add my_private_key.key</code> and then <code>ssh user@mysite.co.uk</code>), it takes less than a second to connect. But if I do it from Python ... | <p>Doh! After posting this question I thought it would be a good idea to make sure sshtunnel was up-to-date - and it wasn't. So I've updated from 0.0.8.1 to the latest version (0.1.0) and my problem is solved!</p>
|
Docker-registry v2 with tls and basic auth behind nginx authentication error <p>Short: I can't login on my docker-registry (hosted on ubuntu-vm (14.04LTS) in a servercenter) from the outside (my local computer running MAC) using a my.domain.ch name.</p>
<p>I <em>can</em> successfully login from the ubuntu-machine (vm-... | <p>I still got no hint how I could fix my problem. Hence I got a workaround: I configured the firewall to forward the port directly to machine running the registry. So I can connect from the outside to my registry using the domainname.</p>
<p>If anyone got an idea how to make it run using nginx I would appreciate an a... |
Getting indirect routes in neo4j considering the order in which they appear in a route <p>So I am trying to get indirect routes in my neo4j graph consisting of stop and route nodes. </p>
<p>Here's my ER diagram of my relational database. </p>
<p><a href="http://i.stack.imgur.com/t61xz.png" rel="nofollow"><img src="ht... | <p>It seems to me you're relying too much on the tabular modeling from your relational db. You're working with Neo4j, so you're going to have to consider the best way to transform your tabular model to something that models well and allows rich queries in a graphical model. In this kind of transformation, much of the p... |
Can we generate odoo reports in excel format? <p>Currently i'm generating OpenErp reports as PDF format from RML code using "OpenErp report Designer" in openoffice .</p>
<p>But how can I generate the report in xls format instead of PDF using same RML code.</p>
<p>If any one have solution / answer please Let me know ... | <p>The Best way to generate Simple xls Report is to use xls_report Module which has xls report engine.</p>
<p>But for complex Designer xls Reports, use xlwt package of python.</p>
|
Couchbase error : Authentication failed when querying a protected bucket Nodejs <p>Below is my sample code to query a pass protected bucket in couchbase in nodejs</p>
<pre><code>var couchbase = require("couchbase");
var cluster = new couchbase.Cluster("couchbase://127.0.0.1");
var N1qlQuery = couchbase.N1qlQuery;
var ... | <p><code>Admin123</code> looks like the root password. You have to provide the password for the specific bucket. Create a password for the <code>bucketname</code> bucket in the admin UI and pass this password.</p>
<p>If you didn't set it up, it might be blank, so </p>
<pre><code>var bucket = cluster.openBucket('bucke... |
How to rollback to a older commit as I have pushed a code? <p>I was working on two different branches <code>A</code> and <code>B</code> and I had one prod branch <code>MASTER</code>, I created a new branch <code>C</code> combining <code>A</code> and <code>B</code>.</p>
<p>I have accidentally pushed <code>C</code>to <... | <p>You can roll back to an earlier commit, check <code>git log</code> for more details,
then force your commit to the master branch:</p>
<pre><code>git push origin +<shaofcommit>:master
</code></pre>
<p><code>+</code> will force the commit, or you can also use <code>-f</code> option.</p>
|
SWT Create Two StyledText That Scroll In Tandem <p>I have to create two <code>StyledText</code> that scroll in tandem , All I am getting is code for creating same using <code>ScrolledComposites</code> . I have limitation of using <code>StyledText</code> only because, I am using it for other purpose as well.
I want to ... | <p>You can use the methods <code>StyledText#setHorizontalPixel()</code> and <code>StyledText#setTopPixel()</code> (and their respecrive <code>get</code> methods) to get and set the positions:</p>
<pre><code>public static void main(String[] args)
{
final Display display = new Display();
final Shell shell = new ... |
How to display variable sized items? <p>I have a list of strings that I want them to be clickable and to be displayed horizontally next to each other, if there is no space left, container should continue to arrange items in the next line. Please help me.
<a href="http://i.stack.imgur.com/TEdSH.png" rel="nofollow"><img ... | <p>You should use a WrapPanel to get that kind of layout. It is not available in Windows Runtime standard controls, <a href="http://www.visuallylocated.com/post/2015/02/20/Creating-a-WrapPanel-for-your-Windows-Runtime-apps.aspx" rel="nofollow">here</a> you can find an implementation for it.</p>
<p>Usage:</p>
<pre><c... |
how to use injection between MVP layers in android? <p>I have been using using <strong>dagger 2</strong> in my project lately,</p>
<p>the problem is when I try to build my project, the presenter in my login
activity which injected like below <strong>is null</strong>,</p>
<p>and when I try to build the project</p>
<... | <p>you need to inform the dagger which views want to use injection, in your component.
you must change the inject function code in your component to below:</p>
<pre><code> void inject(LoginActivity activity);
</code></pre>
<p>for showing dagger what you want, you need to use @dagger annotation NOT by sending it as... |
I am getting the following error when i am trying t o build my project <blockquote>
<p>ld: file too small (length=0) file
'/Users/AshutoshP/Library/Developer/Xcode/DerivedData/TheBouqs-arlmufhxskabmgbuixdzfozlrsph/Build/Intermediates/TheBouqs.build/Debug-iphonesimulator/TheBouqs.build/Objects-normal/x86_64/HomeVC.o... | <p>I got same issue but I was able to solve it with following steps :</p>
<ul>
<li>Just Clear The Derived Data Contents From Xcode.</li>
<li>Quit and Restart XCode.</li>
</ul>
<p>For Clear <strong>Derived Data</strong> you can use following steps or another SO <a href="http://stackoverflow.com/questions/18933321/dele... |
How to refresh RecyclerView from button on DialogFragment <p>I have an application with a <code>RecyclerView</code> and a <code>DialogFragment</code>, in the Dialog I add data to the database and display it in the <code>RecyclerView</code>. I tried to refresh the <code>RecyclerView</code> when I clicked in to add.</p>
... | <p>Call <code>mAdapter.notifyDataSetChanged();</code> in your Activity's <code>onResume()</code> method.</p>
|
jackson2 - unexpected field in JSON <p>I'm trying to write a JSON from a java object. Everything works fine until I write the values to a String using the ObjectMapper. The String shows an unexpected field in the JSON document called "map".</p>
<p>I want this:</p>
<pre><code>{
"name": [
{
"a": "1",
... | <p>Please notice that inside the class you are serializing you have a parameter called <code>map</code> if you called it <code>bla</code> you would have seen:</p>
<pre><code>{
"name": [
{
"bla": {
"a": "1",
"b": "2",
"c": "3",
"d": "4",
"e": "5",
"f": "6"
}
]
}
</code></pre>
<p>in order... |
how to press Ctrl + ] in Selenium web driver <p>I have the ff.code which opens a chrome browser and press "F12" to open chrome dev tools, I've been searching in google on how to press Ctrl+] but unfortunately did not find any article/info about it. Has anyone here made this stuff? thanks!</p>
<pre><code> IWebDriver... | <p>Use either</p>
<pre><code>Actions action=new Actions(driver);
action.SendKeys(OpenQA.Selenium.Keys.Control + "]").Build().Perform();
</code></pre>
<p>or</p>
<pre><code>yourWebElement.SendKeys(Keys.Control + "]");
</code></pre>
|
How to add jquery plugins using webpack? <p>I am using webpack with angular 2 for my web appllication i need to add a jquery slider to my app , so i am using a jquery plugin for that . </p>
<p>My webpack config for jquery is </p>
<pre><code>new ProvidePlugin({
jQuery: 'jquery',
$: 'jquery',
jquery: 'jq... | <p>in main.ts include</p>
<pre><code>import 'jquery';
</code></pre>
<p>once.</p>
<p>then in webpack config</p>
<pre><code> new ProvidePlugin({
jQuery: 'jquery',
'window.jQuery': 'jquery',
$: 'jquery',
'window.$': 'jquery'
})
</code></pre>
|
Javascript to format number as currency <p>I have the following code.</p>
<pre><code><select id="cage_options">
<option>Please select</option>
<option value="2,63330">option1</option>
<option value="3,13300">option2</option>
<option value="4,2000.00">option3&... | <p>You have a string and a string does not have .toFixed(). So need to convert that string to be a number.</p>
<pre><code>cage_option = Number(select[1]);
</code></pre>
<p>or</p>
<pre><code>cage_option = parseFloat(select[1]);
</code></pre>
|
Bootstrap 3 glyphicon not working inside a button <p>I have a strange issue with Bootstrap Glyphicons. I can't get <code>glyphicon glyphicon-option-horizontal</code> and <code>glyphicon glyphicon-option-vertical</code> to work inside a button like this:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data... | <p>add latest <code>bootstrap css</code> <code>version 3.3.7</code> is working now</p>
<pre><code><button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<span class="glyphicon glyphicon-option-horizontal"></spa... |
Difference between JSON and JSONB in Postgres <p>What's difference between JSON and JSONB data type in PosgresSQL?</p>
<ol>
<li>When should be used specific one? </li>
<li>What's benefits or disadvantages with respect to other?</li>
</ol>
| <p>This is explain:
<a href="https://www.citusdata.com/blog/2016/07/14/choosing-nosql-hstore-json-jsonb/" rel="nofollow">https://www.citusdata.com/blog/2016/07/14/choosing-nosql-hstore-json-jsonb/</a></p>
<blockquote>
<p>In most cases JSONB is likely what you want when looking for a NoSQL,
schema-less, datatype. H... |
EnvDTE.CodeNamespace members are empty? <p>I am trying to find a function in active document however I am struggling with a problem, when the function is inside of a namespace, my code is trying to get the members of the EnvDTE.CodeNamespace object but it returns empty, I tried Children too but it was empty too.</p>
<... | <p>I recommend a different way to get current function:</p>
<pre><code> EnvDTE.TextSelection ts = DTE.ActiveWindow.Selection as EnvDTE.TextSelection;
if (ts == null)
return;
EnvDTE.CodeFunction func = ts.ActivePoint.CodeElement[vsCMElement.vsCMElementFunction]
as EnvDTE.CodeFunction;... |
Thread:1 Signal SIGAGBRT <p>Why do I get a Thread:1 Signal SIGAGBRT within this code? I don't know what to change to fix the error. The application starts and as soon as I press the button the app cancels out and gives me an error.</p>
<pre><code>import UIKit
class ViewController: UIViewController {
@IBOutlet va... | <p>Select your button from interface builder, then select <code>connection inspector</code> from <code>utilities</code> and check that if you have extra connected action method should be there, remove it by clicking <code>x</code> and your issue will be solved!</p>
<p>It's should be <code>btnPressed</code> as per your... |
Winforms SplitterPanel, z-index of child overlap split <p>I am working with a SplitterPanel in winforms where on the right hand side I want a custom dropdown list control which displays a 2 columns dropdown list.</p>
<p>The problem is that with there being two columns I want to be able to have a larger dropdown list a... | <p>The z-index will determine which <strong>child</strong> controls sit higher and can overlap which others child controls. But it never helps when you want a (real as opposed to drop downs or menues) <strong>child</strong> overlap its own <strong>container</strong>. This never happens; and since the <code>CheckedListB... |
Toggle checkboxes on PHP table <p>I have a table with a checkbox in the table header, which will be used to toggle all the checkboxes below it. I've add a JavaScript function to the checkbox in the header, but so far it only selects the top checkbox (one checkbox) instead of all of them. Any suggestions or advice on wh... | <p>The problem is you setting the same ID (<strong>cb1_1</strong>) to all the checkboxes (which is invalid in HTML) Id should be unique in the page. Thus, it only select the first found checkbox and discard the rest. To resolve this give unique ids to checkboxes.</p>
<pre><code>$table .= '
<tr>
... |
HIVE COUNT * OUT OF MEMORY <pre><code> hive> select count(*) from ipaddress where country='China';
WARNING: Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. tez, spark) or using Hive 1.X releases.
Query ID = pruthviraj_20160922163... | <p>go to env file and increase -Xmx2048m to -Xmx4096m</p>
<p>-Xmx4096m -XX:PermSize=128m -XX:MaxPermSize=128m</p>
|
How can JWT be verified outside the authorization server <p>Recently, I'm trying to implement an OAuth2.0 server using JSON Web Token (JWT) as access token. I'm very confused about the self-contained feature of JWT. I notice that JWT can be verified anywhere, not mandatorily in authorization server because it is self-c... | <p>JWT contains claims that can be signed, encrypted or both.
These operations are performed using cryptographic keys. Keys can be symmetric (e.g. <code>oct</code>et keys) are Asymmetric (e.g. private/public key pairs such as <code>RSA</code> or <code>EC</code> keys).</p>
<p>When you want to verify a JWT (i.e. a JWS),... |
Is there a better way to accomplish the combination reset, checkout, cherry-pick, checkout, rebase? <p>Suppose I have the following history:</p>
<pre><code>A ââ¶ B -- master
â²
â
C ââ¶ D ââ¶ E -- feature
</code></pre>
<p>At point <code>E</code>, I stuble upon a small bug in the code... | <p>You may be interesting by <a href="https://github.com/lennartcl/gitl" rel="nofollow">gitl project</a> under github which provide <strong>git cherry-copy</strong> and <strong>git cherry-move</strong> commands. This is not possible to do it faster using git core commands.</p>
<p>Original answer from <a href="http://s... |
IOS swift Login with Google Plus <p>While testing google-plus-ios-sdk-1.7.1 on the iOS 9 SDK, invoking GPPSignIn.sharedInstance() ends up crashing on an internal Google Sign-In SDK call to canOpenURL</p>
<pre><code> 2016-09-22 14:12:56.135 MCN[305:49025] -canOpenURL: failed for URL: "com.google.gppconsent.2.4.1://" ... | <p>i think below will may be work for you.</p>
<pre><code><key>LSApplicationQueriesSchemes</key>
<array>
<string>com-google-gidconsent-google</string>
<string>com-google-gidconsent-youtube</string>
<string>com-google-gidconsent</string>
... |
Cannot resolve property "criticismEngine" error in Spring xml configuration <p>I have taken this example from the book on Spring and it should create an instance of the aspect "СriticAspect" with a help of a static aspectOf() method, but I get "Cannot resolve property "criticismEngine" error while configuring CriticAs... | <p>Like I said in <a href="http://stackoverflow.com/a/29455813/1082681">my answer to a similar question</a> which was even about the very same code snippet from the same book:</p>
<p>I think that you need to decide whether to use</p>
<ul>
<li>Spring AOP via <code><aop:aspectj-autoproxy/></code> or</li>
<li>Aspe... |
Can lambda be used instead of a method, as a key in sorted()? <p>This is my first time asking a question. I've already got so much help from you without even asking. (Gratitude face).
So, I found this useful piece of code from around here a few weeks ago.</p>
<pre><code>import re
def yearly_sort(value):
numbers =... | <p>It definitely can be <code>lambda</code> function. For example look at that <a href="http://stackoverflow.com/questions/3766633/how-to-sort-with-lambda-in-python">question</a>.</p>
<p>But if you have complex function you should never move it to <code>lambda</code> because readability significantly decreases.</p>
<... |
How to set Bit width/precision of the depth buffer(z buffer) in OGRE? <p>I read that the zbuffer_value can be found using</p>
<pre><code>z_buffer_value = (1<<N) * ( a + b / z )
</code></pre>
<p>Where:</p>
<pre><code>N = number of bits of Z precision
a = zFar / ( zFar - zNear )
b = zFar * zNear / ( zNear - zFar... | <p>Cross-post: <a href="http://www.ogre3d.org/forums/viewtopic.php?f=2&t=89958" rel="nofollow">Same question ogre3d.org/forums</a></p>
<hr>
<p>You can get the bit depth of the depth buffer via this method:</p>
<pre><code>uint16 DepthBuffer::getBitDepth() const
</code></pre>
<p><a href="http://www.ogre3d.org/doc... |
ImageButton over action bar android <p>I want imagebutton over action bar in my app like this:</p>
<p><a href="http://i.stack.imgur.com/ZIalj.png" rel="nofollow"><img src="http://i.stack.imgur.com/ZIalj.png" alt="enter image description here"></a></p>
<p>My xml code is:</p>
<pre><code><?xml version="1.0" encoding... | <p>change your relative layout to <strong>framelayout</strong> or coordinator layout then give <strong>margintop</strong> to your image button this will do the trick</p>
<p>have a look at the layout below</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android... |
Make different editions of an application with single code base <p>I have developed an application for Windows desktop (in WPF). Let's assume this application has 50 features and let's call it <strong>ULTIMATE</strong> application.</p>
<p>I have another client which demands application with 30 features. Let's call thi... | <p>Generally this is handled based on the product key. The algorithms for generating and reading the version depends developer to developer.</p>
<p>Lets take a simple example your product keys start by prefixing it's version e.g. -
Ultimate version starts with "U" and will look like - Uxxxxxxxxxxxx
Professional versi... |
Rails, current_page?(user_path) giving an error <p>I have element witch I want hide on specific pages, for example on pages located at <code>app/views/users/</code> (there I have <code>new.html.erb</code>; <code>edit.html.erb</code>; <code>show.html.erb</code>. And I have div in my <code>layouts/application.html.erb</c... | <p>Not entirely sure what you are trying to achieve, but this is how you can guard from user not being present:</p>
<pre><code>unless current_page?(new_user_path) || @user && current_page?(user_path(@user))
</code></pre>
|
Can't bind to 'userID' since it isn't a known property of 'view-user' <p>I have the following template expression:</p>
<p></p>
<p>which refers to ViewUserComponent which contains:</p>
<pre><code>@Input() userID;
</code></pre>
<p>Why I get the following error?</p>
<pre><code>Can't bind to 'userID' since it isn't a ... | <p>1) <strong>ngIf="doSelect"</strong> can create problem so be sure about it that it works as expected.</p>
<p>2) <strong>[userID]="selectedUser?.id"</strong> as shown, you can try <code>?.</code> operator (I assume SelectedUser object comes from server).</p>
|
angular/ionic iframe issue on ios <p>I have an issue with my ionic app on iphone. Ionic writes this into the index.html:</p>
<pre><code><iframe src="gap://ready" style="display:none;">...</iframe>
</code></pre>
<p>The console output of the app loops this error about 40 times per second:</p>
<pre><code>Re... | <p>Solution, simply add gap: to the following meta tag:</p>
<pre><code><meta http-equiv="Content-Security-Policy" content="default-src * data: cdvfile: gap:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
</code></pre>
|
Google sheets - Get all cells in a sheet with A1 notation when the sheet's name conflicts with a cell <p>Using the new v4 Google sheets api, is it possible to get a range of all cells in a spreadsheet when it conflicts with a cell in A1 notation ? </p>
<p>For example, I have a sheet called <code>A001</code>. </p>
<ol... | <p>Unfortunately, parsing as a cell or a named range will take precedence over a sheet name. You can workaround this by choosing a suitably large range and requesting that, e.g: <code>A001!A:ZZZ</code> -- that will request all rows in column <code>A</code> through column <code>ZZZ</code> in sheet <code>A001</code>. T... |
Concatenate fields and join tables using iReports <p>I'm trying to concatenate two fields in one table and another two fields in another table and using the concatenated value as the primary key to join the tables together. </p>
<p>Due to the fact that the primary key is linked to example 5 different people i need a u... | <p>I was able to resolve the query by merely</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>SELECT t1.scheme_fk,t1.ms_fk,t1.dep_fk,t1.pr_fk,t1.tariff_fk,t1.icd10_fk,t1.... |
css flexbox column error <p>I'm trying to make a layout like the following image using css flexbox.</p>
<p>But I'm not much familiar with flexbox anyone can help me to make this? </p>
<p><a href="http://i.stack.imgur.com/BcGog.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/BcGog.jpg" alt="enter image descript... | <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>.row.flex {
display: flex;
flex-wrap: wrap;
}
.row [class^="col-"] {
flex: 0 0 calc(50% - 10px); /* don't g... |
Could not resolve com.commonsware.cwac:camera:0.6.+ <p>I have added tedpicker in my applications from <a href="https://github.com/ParkSangGwon/TedPicker" rel="nofollow">https://github.com/ParkSangGwon/TedPicker</a></p>
<p>but now for weeks when I try to sync gradle with internet this error shows up</p>
<pre><code>Err... | <blockquote>
<p>I have added tedpicker in my applications</p>
</blockquote>
<p>I do not recommend using that library, since it has a dependency on a discontinued library (namely, my CWAC-Camera library).</p>
<blockquote>
<p>but now for weeks when I try to sync gradle with internet this error shows up</p>
</blockq... |
How to read data from a table and form an array and post it? <p>I want to get data and display it on a table then modify the "availability" and again post it to the server by forming an array of object. Right now the way I am doing it I am able to get the data but it is not coming with modification . </p>
<pre><code>&... | <p>You need a function to post, you'd better create that in service. Make sure to inject $http</p>
<pre><code>function postman(url, data) {
var res = $http.post(url, data);
res.success(function (data, status, headers, config) {
console.log('success');
});
res.error(function ... |
Raising my own Exception in Python 2.7 <p>I copied and pasted these lines of code from a Pyhton tutorial book. Why does this code not work when I try to run it in PyCharm?</p>
<pre><code>def inputNumber ():
x = input ('Pick a number: ')
if x == 17:
raise 'BadNumberError', '17 is a bad number'
return ... | <p>You can use standard exceptions:</p>
<pre><code>raise ValueError('17 is a bad number')
</code></pre>
<p>Or you can define your own:</p>
<pre><code>class BadNumberError(Exception):
pass
</code></pre>
<p>And then use it:</p>
<pre><code>raise BadNumberError('17 is a bad number')
</code></pre>
|
fetch distinct and unique contacts from the phone avoiding duplicity <p>i want to retrieve the contact list from the phone avoiding any duplicates. i think it is retrieving the contacts from google account,phone or sim. so how to avoid the duplicate contacts. though a contact can have same number but with different num... | <p>I am not sure whether it is reliable or not, but it worked for me</p>
<p>First copy the contacts in <code>ArrayMap</code> with phone numbers as key and contact name as value. In this method, even if the phone numbers are repeated, it will just update the name.</p>
<p>Once ArrayMap is createt, you can use iterator ... |
Jmeter while controller gets stuck on request and does not loop <p>I am writing a test that waits for a specific response using while controller.
To be more precise, I send a message with jmeter, then that message gets state "sending" and after about 30 seconds it state changes to "received". So using while controller... | <p>It is not looping means, condition in While controller is not satisfied, not returning <code>true</code>.</p>
<p>By the way, <code>${__javaScript("${State}".indexOf("Received") == -1,)}</code> means that, condition is true when <code>State</code> does not contains <code>Received</code>.</p>
<ul>
<li><code>indexOf... |
Tizen native app IDE <p>I am not able to open Native perspective in my tizen studio.
I downloaded tizen studio IDE from <a href="https://developer.tizen.org/development/tizen-studio/download" rel="nofollow">https://developer.tizen.org/development/tizen-studio/download</a>. After installation it shows option for web app... | <p>Open "Package-Manager" from "tizen-sdk" folder. You will find this folder in Tizen installation directory.</p>
<p>In âMain SDKâ check for âNative app. development (IDE)". See If "Native app. development (IDE)" is
installed. If it is not already installed, install it.
Then close "Package-Manager" and reopen Ti... |
How to perform Add, Edit and Delete operations for JSON data using AngularJS? <p>I have the json file:</p>
<pre><code>test.json:
{
"MyTest": [{
"Main": {
"static": {
"name": "TestName1"
},
"dynamic": {
"testkey01": "testkey01data",
... | <p>here is the answer based on our discussion. It may be lengthy since I worked on all the files and added them,</p>
<p>First of all,</p>
<p><strong>index.html</strong></p>
<pre><code><!DOCTYPE html>
<head>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0/angular.min.js"></script... |
Error when using Highcharts with Angular 2 <p>I am using <a href="https://www.npmjs.com/package/angular2-highcharts" rel="nofollow">angular2-highcharts</a>
The <code>component.ts</code> file is as below:</p>
<pre><code>import { Component } from '@angular/core';
import { CHART_DIRECTIVES } from 'angular2-highcharts';
... | <p>I did the following things:</p>
<p><strong>systemjs.config.js</strong></p>
<pre><code>map: {
// our app is within the app folder
app: 'app',
'angular2-highcharts': 'node_modules/angular2-highcharts',
'highcharts': 'node_modules/highcharts'
}
packages: {
... |
pattern matching in sudoers file using tab space in pattern <p>I need to write a shell script to check the entry is there or not in /etc/sudoers file </p>
<p>this is the pattern i need to check
<strong>nimbus ALL=(ALL) NOPASSWD:ALL</strong> </p>
<p>in this pattern word to word tab space is there </p>
<p>... | <p>The problem with your script is, you are not escaping(<code>\</code>) the meta-characters(<code>(</code> and <code>)</code> in this case) for <code>grep</code> to identify them as they have a special meaning.</p>
<p>Also quoting variables prevents word splitting and glob expansion, and prevents the script from brea... |
How to add to String Array from inside recursive function in C <p>I am trying to write a C function that will give me the binary representation of a number <code>n</code>. The function I have prints the number correctly; however I would like the string array <code>word</code> to be updated with the same data as is bein... | <p>Here's my attempt:</p>
<pre><code>#include <stdio.h>
#include <stdlib.h>
#define MAXBIN 100
char * printbitsrec(unsigned n, int n_bits, char *w)
{
if (n_bits-- > 0) {
w = printbitsrec(n >> 1, n_bits, w);
const char c = (n & 1) ? '1' : '0';
putchar(c);
*... |
Ruby and Chef difference in hashes <p>I've been programming in ruby for a little while now and have heard that using symbols for accessing values in hashes is a "better practice" than using strings, e.g.</p>
<pre><code>default[:key] = value
over
default['key'] = value
</code></pre>
<p>I've been working on a chef ... | <p>T.L;D.R. Accessing attributes by symbol is discouraged in favor of strings, despite still in use.</p>
<p>Quoting lamont granquist from Chef in a foodcritic (linter) issue <a href="https://github.com/acrmp/foodcritic/issues/86#issuecomment-74186035" rel="nofollow">here</a></p>
<blockquote>
<p>Chef implementation ... |
Django and dates in UTC <p>I use Django with <code>USE_TZ</code> set to <code>True</code>. I also set my <code>TIME_ZONE</code>. The thing is datetimes are stored in DB in UTC (-2 hours to my timezone). But when I print the datetime to template it's still in UTC.</p>
<p>How do I automaticaly tell Django to print the d... | <p>You can get your local time by using Arrow and DateTime packages. And you can use Arrow to convert date & time in your required formats. Install arrow in your virtualenv by using pip command.</p>
<pre><code>import arrow
import datetime
today = arrow.utcnow().to('Asia/Calcutta').format('YYYY-MM-DD HH:mm:ss')
'2... |
ngif is not working properly <p>I want to use ngif to check some int that comes back from a function, and if its bigger then 0 I want to present it, so this is what I did:</p>
<pre><code> <div>
<b>Name:</b>{{person.getName()}}<b>balance left:</b>
<div *ngif="person.getBalance()>0"&g... | <p>You misspelled it. Try removing the * and put a - between ng and if.</p>
<pre><code><div ng-if="person.getBalance()>0">{{bulk.getBalance()}}</div>
</code></pre>
<p>I think that that doesn't work either because you're evaluating a method. Instead store Balance in a variable like this:</p>
<pre><code... |
Meaning of asterisk following a member function <p>I am fairly new to C++ and I am trying to decode the piece of code shown below. In particular for the <code>BaseSetAssoc::BlkType*</code> line, I am not sure what the asterisk means in this case. I would appreciate some insight. </p>
<pre><code>BaseSetAssoc::BlkType*
... | <p><code>BlkType</code> isn't a member function, it's a type, possibly an enum or struct if not an inner class.</p>
<p>The <code>BaseSetAssoc::</code> is needed to access such "inner" types (defined within a class, <em>i.e.</em> <code>BaseSetAssoc</code>).</p>
<p>So <code>BaseSetAssoc::BlkType*</code> is just a <code... |
Robolectric 2 with JNI <p>In my app I stared using an external library that uses JNI.<br></p>
<pre><code>System.loadLibrary("somelib")
</code></pre>
<p>Also I have unitests with <code>Robolectric 2</code>. When I'm running these tests I'm getting the following exception:</p>
<pre><code>java.lang.UnsatisfiedLinkError... | <p>Unfortunately, <strong>Robolectric</strong> doesn't work with JNI. My suggestion would be to wrap JNI library loading into class and mock it under the test, or override JNI method loading in test:</p>
<pre><code>public class MyApp extends Application {
public void onCreate() {
loadJNI();
}
protected... |
How to access a document library in a sharepoint online site using MS graph <p>I am able to access the documents on my one drive with requests like this one: </p>
<pre><code>https://graph.microsoft.com/v1.0/me/drive/root/children
</code></pre>
<p>I am able to access a document library of a root sharepoint site of my ... | <p>For accessing SharePoint sites and lists check out the <a href="http://graph.microsoft.io/en-us/docs/api-reference/beta/resources/sharepoint" rel="nofollow">BETA reference</a> documentation.</p>
|
Selenium-webdriver Phantom and Firefox SSL issue <p>Given I have node dependencies:</p>
<pre><code>{
"chromedriver": "^2.24.1",
"cucumber": "^1.3.0",
"geckodriver": "^1.1.2",
"phantomjs-prebuilt": "^2.1.12",
"selenium-webdriver": "^3.0.0-beta-2"
}
</code></pre>
<p>I would like to set the Phantomj... | <p>This is only for Javascript / Node.js Selenium Webdriverjs case, only MacOS solution.</p>
<ol>
<li><p>Firefox case:</p>
<p>a. Setup a new Profile using the Profile Manager for Firefox.</p>
<ul>
<li>Open the Profile Manager with <code>/Applications/Firefox.app/Contents/MacOS/firefox-bin -P</code> (<code>-profilema... |
Fetch batch of iOS pictures <p>I would like to fetch fixed batches of the pictures located on an iOS device. I am using the new <a href="https://developer.apple.com/reference/photos" rel="nofollow">Photos Framework</a>, and I already found this workaround: </p>
<pre><code>PHFetchOptions *allPhotosOptions = [PHFetchOpt... | <p>After a more detailed search, I finally found <a href="http://stackoverflow.com/questions/11165348/batching-core-data-fetch-results?rq=1">here</a> what I was looking for :
One just could use <code>setFetchBatchSize</code> from <code>NSSortDescriptor</code>.</p>
|
Xamarin forms how to pass Entry value from one to class to another class List? <p>I want to pass inserted number value from page where I am inserting value to another page list and update ListView with new value.</p>
<p>Here is my AddCardPage xaml:</p>
<pre><code><Entry x:Name="CardNr" Text="" Completed="Entry_Com... | <p>In the page you want to get the value change it's constructor to accept the value and pass that value from the calling page. </p>
<p>Eg: </p>
<pre><code>class Page1
{
private async void OnSomeEvent()
{
await Navigation.PushAsync(new Page2("xyz"));
}
}
class Page2
{
public Page2(string myValue)
{
... |
Gitlab - Build docker images from within docker shared runner <p>Trying to build a docker image from withing shared runner, below is the CI configuration</p>
<pre><code>image: osrg/dind-ubuntu-vivid
services:
- docker:dind
stages:
- build
- test
- release
variables:
CONTAINER_TEST_IMAGE: registry.gi... | <p>Use different image for each stage, in your case use <code>osrg/dind-ubuntu-vivid</code> for build and test, and docker image in release stage with dind service. Check this <a href="http://stackoverflow.com/questions/39608736/docker-in-docker-with-gitlab-shared-runner-for-building-and-pushing-docker-image">thread</a... |
Compare two hash of arrays <p>I have two arrays and a hash holds these arrays</p>
<pre><code> Array 1:
my $group = "west"
@{ $my_big_hash{$group} } = (1534,2341,2322,3345,689,3333,4444,5533,3334,5666,6676,3435);
Array 2 :
my $element = "Location" ;
my $group = "west" ;
@{ $my_tiny_hash{$element}{$grou... | <p>This seems to do what you want.</p>
<pre><code>#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
my (%big_hash, %tiny_hash);
my $group = 'west';
my $element = 'Location';
# Less confusing initialisation!
$big_hash{$group} = [1534,2341,2322,3345,689,3333,4444,5533,3334,5666,6676,3435];
$tiny_hash{$element}{$gr... |
.net Serializing XML in a compact, human-readable way <p>I'm serializing a structure that results in this output:</p>
<pre><code><NachrichtenKonfiguration>
<Elemente>
<Element>
<Typ>Bool</Typ>
<Bezeichnung>Gut</Bezeichnung>
</Element>
<Elemen... | <p>Ok I got it, you simply need to add the [XmlAttribute]-tag over the corresponding declaration.</p>
<p>Here's how. If you have a class called "Person" and you have two attributes in it, write the code like this:</p>
<pre><code>[Serializable]
public class Person
{
[XmlAttribute]
public int Age;
[XmlAttri... |
postgresql query tool stays frozen even after query is over <p>I am running postgresql 9.6 in my windows 7 laptop. Nobody else connects to the database. I ran an Insert SQL in Query Tool of Pgadmin4. The query got over after 20 minutes or so. The records got inserted & the state in pg_stat_activity went from active... | <p>Not exactly a solution but got a work around. The problem was that after query execution it was running the autovacuum and then even after it got over, pgadmin was staying frozen. I disabled autovacuum in the config file and it started working fine. Not sure if this will have any impact on performance or anything el... |
Convert pandas dataframe column with xml data to normalised columns? <p>I have a <code>DataFrame</code> in <code>pandas</code>, one of whose columns is a XML string. What I want to do is create one column for each of the xml nodes with column names in a normalised form. For example,</p>
<pre><code> id xmlcolumn
... | <p>The first step that needs to be done is to convert the XML string to a pandas <code>Series</code> (under the assumption, that there will always be the same amount of columns in the end). So you need a function like:</p>
<pre><code>def convert_xml(raw):
# some etree xml mangling
</code></pre>
<p>This can be ach... |
How to create Tree-View in Angular 2 using Typescript? <p>What should I do how to create Tree view in Angular 2 using Typescript?</p>
<p>I am trying to find out on google but till-now not get any working example etc.</p>
<p>Can anyone please share me example to achieve this task#?</p>
| <p>Why not use a ready made one, for example angular2-tree-component?</p>
<p><code>npm install angular2-tree-component</code></p>
|
TableViewCell image is not shown <p>I am using Xcode 8.0 and SWIFT 3 for my development environment.
I am designing the storyboard as below, but I don't know why the image in the TableViewCell is shown on runtime but not on storyboard.</p>
<p>Does anyone have a clue?</p>
<p><a href="http://i.stack.imgur.com/evqGE.png... | <p>Looks like a bug. Try changing the device to 6s plus or something else in <code>view as:</code> option in Storyboard. It might do the trick.</p>
<p><a href="http://i.stack.imgur.com/Kcd1d.png" rel="nofollow"><img src="http://i.stack.imgur.com/Kcd1d.png" alt="enter image description here"></a> </p>
|
How to start Websphere Mq Service? <p>i am using Web sphere version 7.5,does that require System Broker for starting MQ service.How can i start MQ service when i access through Java code. Currently i am getting the following exceptions when access through a code</p>
<p>MQJE001: An MQException occurred: Completion Code... | <p>Your application is calling <code>_queueManager.disconnect()</code> in <code>read</code> method. This closes the connection to queue manager. Then your application are calling <code>accessQueue</code> method using the same disconnected _queueManager object. This will fail with connection error. </p>
<p>Suggest you ... |
How to query autocomplete for restaurants in Google Places API <p>I am looking for an example query that returns a list of just restaurants for use as an autocomplete given a piece of partial text with or without a coordinates position.</p>
<p>I see an example with geocode, but this returns physical places.</p>
<p>I ... | <p>Try this code. you can always check the documentation of google places api for such questions. The supported types are listed <a href="https://developers.google.com/places/supported_types" rel="nofollow">here</a></p>
<pre><code> <label for="restaurant">
<input id="restaurant" name="restaurant... |
What is the difference between kibana and opentsdb <p>As I know kibana and opentsdb both can be used in conjunction with Elastic logstash kibana (ELK) stack. </p>
<p>OpenTSDB offers a built-in, simple user interface for selecting one or more metrics and tags to generate a graph as an image. Alternatively an HTTP API i... | <p>OpenTSDB is a time-series database. You could use OpenTSDB alongside Elasticsearch, for the metrics component. You would use Elasticsearch for text (logs perhaps) and OpenTSDB for metrics. </p>
<p>If you are using Logstash, there is an <a href="https://www.elastic.co/guide/en/logstash/current/plugins-outputs-opents... |
Laravel Auth Custom Fields <p>Trying to add a custom field to auth, to check if a user is 'activated' before allowing login</p>
<p>I've tried modifying <code>AuthenticatesUsers.php</code> although I now understand this file shouldnt be edited directly.</p>
<p>Here is what I tried and it did not work.</p>
<pre><code>... | <p>You can also add the custom field by manaually authenticating the users.</p>
<pre><code>public function postLogin(Request $request)
{
$this->validate($request, [
$this->loginUsername() => 'required', 'password' => 'required'
]);
if (Auth::attempt(['email' => $request->email, ... |
Bind results from search <p>I cannot bind results from search in kendo grid. I've tried many times, I'm in trouble four days, I don't know what is wrong here,</p>
<p>When i debug action everything is working perfect,data is OK, return grid result are OK, but results aren't shown in kendo.</p>
<p>Here is my code:</p>
... | <p><code>DataSourceResult</code> formats your server response like this:</p>
<pre><code>{
Data: [ {JobNumber: "...", FieldName: "bar", ... } ],
Total: 100
}
</code></pre>
<p>In other words, the data items array is assigned to a <code>Data</code> field, and the total items count is assigned to a <code>Total</c... |
OBIEE 12C changing default font size <p>I'm currently on a project using OBIEE 12C and the customer wants to change the default font size, but we don't know how to do this. We've found this link: <a href="https://biskills.wordpress.com/2013/04/27/increasing-the-font-size-of-the-dashboard-pagetab-in-obiee/" rel="nofollo... | <p>What you need to do is deploy a custom skin, that you can customise. The authoritative instruction for this is in the application documentation, under <a href="http://docs.oracle.com/middleware/12211/biee/BIESG/GUID-237D613D-CC0D-464D-BBC2-9A223CD12567.htm" rel="nofollow" title="Customizing the Oracle BI Web User In... |
AudioInputStream to base64 <p>I'm using some code to read some audio files from <code>HTTP GET</code> requests and mixing them up. I end up with an <code>AudioInputStream</code>. If I write it to a file (<code>ais</code> is the <code>AudioInputStream</code>) with the code bellow the file is created with success and if ... | <p>Managed to do it by writing it to a <code>ByteArrayOutputStream</code> instead and then converting the byte array to <code>base64</code></p>
<pre><code>baos = new ByteArrayOutputStream();
AudioSystem.write(
ais
,AudioFileFormat.Type.WAVE
,baos);
audioInByteArray = baos.toByteArray();
</code><... |
.delay() not working on my .show() JQuery <p>I'm trying to make my footer disappear when on a mobile device and only when the keyboard is open. Which I have working perfectly, however the issue is that the footer reappears before the keyboard has time to close. Which is because I'm using the event from the textbox havi... | <pre><code>$("#footer").delay(500).show(0);
</code></pre>
<p>Try this.</p>
|
Specify name of OSX application file for Eclipse RCP app <p>I have an Eclipse RCP application that I have been managing for a few years. I am updating it from Luna to Neon as the base and have updated to Tycho 0.26 in the process.</p>
<p>One of the new features in Eclipse since Luna is that on OSX the application is ... | <p>Figured it out. Just need to add configuration to the tycho-p2-director-plugin that was in my product pom.xml</p>
|
How to select top N salaries for each person? <p>I have the table </p>
<pre><code>user_id salary month
1 100 1
1 150 2
1 200 3
1 180 4
1 140 5
2 10 1
2 40 2
2 20 3
2 15 4
2 45 5
</code></pre>
<p>I want to select ... | <p>You are close, just not selecting the right values:</p>
<pre><code>select sal.*
from (select distinct s.user_id from Salary s) s cross apply
(select top 2 sal.*
from Salary sal
order by sal.salary desc
) sal;
</code></pre>
<p>Note that a typical way of doing this would use <code>row_numbers()... |
npm start gives weird error 8 with Unexpected token ILLEGAL <p>I am getting weird error 8 with below output while doing $ npm start</p>
<pre><code>SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Functio... | <p>You are using Node 0.10 - currently the LTS version is 4.5.0 and the Current version is 6.6.0. Consider upgrading Node because you are using a very outdated version. Node 0.10 was released on March 2013, its maintainence period ends in a week (on October 1, 2016) and then it will no longer get any updates, see: <a h... |
Nested directive, where child directive is based on parent attribute <p>Is it possible to "tell" a directive to use another specific directive, based on the attributes provided to the first directive?</p>
<p>An example:</p>
<p>Let's say i have the following HTML</p>
<pre><code><parent-directive child-type="foo" /... | <p>Seems like you want to achieve some kind of transclusion <a href="http://teropa.info/blog/2015/06/09/transclusion.html" rel="nofollow">http://teropa.info/blog/2015/06/09/transclusion.html</a></p>
<pre><code><parent-directive>
<foo></foo>
</parent-directive>
.directive('parentDirective', ... |
ValidationResult throws : "Object reference not set to an instance of an object". when passing back choices <p>Please find the below exception.</p>
<blockquote>
<p>Stack Trace: Exception: Exception caught:
'Microsoft.Bot.Builder.FormFlow.FormCanceledException1' in
mscorlib.dll ("Object reference not set to an in... | <p>I tried again and figred out that i had to provide all the property values for choices like below</p>
<pre><code> var choices = new List<Choice>();
choices.Add(new Choice { Description = new DescribeAttribute("Tes1", null, "Tes1", null, null), Value ="Tes1", Terms = new TermsAttribute("Tes1", "T1")});
choic... |
I want to return false in clicked time is greater than 200 ms <p>I am developing a youtube player. If user long presses on video, a option panel appears. I want to stop it. Is it possible that I write a query that if my click time is greater than 200ms, return false? I am currently using this code but this is not worki... | <p>As @Maxx said, simply declare your variables first</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-js lang-js prettyprint-override"><code>var longpress = false;
var pressTimer;
$('video').on('click', functio... |
How do I set case for tar, gz and tar.gz files? <p>I have few files in a directory like this:</p>
<pre><code>xxx.tar.gz
xxx.tar
yyy.tar.gz
yyy.tar
zzz.txt.gz
...
...
</code></pre>
<p>I have list.txt for files like this:</p>
<p>list.txt:</p>
<pre><code>/home/phe/xxx.tar.gz
/home/phe/xxx.tar
/home/phe/yyy.tar.gz
/hom... | <p>You could do something like that:</p>
<pre><code>while IFS= read -r file; do
file="${file##*/}" # remove the directory
case $file in
*.tar.gz)
tar xzvf "$file"
;;
*.txt.gz)
gzip -d "$file"
;;
esac
done < list.txt
</code></pre>
<p>Note t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.