input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Fragment not attached to Activity in AlertDialog <p>Any idea why I'm having an illegal state exception with this code block?</p>
<pre><code>mDialog.setButton(AlertDialog.BUTTON_POSITIVE, "OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
... | <pre><code> startActivity(viewIntent);
dialog.dismiss();
replace with below
dialog.dismiss();
startActivity(viewIntent);
</code></pre>
<p><strong>Is it because I'm dismissing the dialog after starting a new activity?</strong></p>
<p><strong>Ans : Yes</st... |
jsonapi-resources; wrong self link <p>I configured json-resouce-api.
But the self link generated by json-resource-api is wrong.</p>
<p>The code seems to checks the module hierarchy of the resource class and completely ignores how rails generates the routes.</p>
<h2>routes.rb</h2>
<pre><code>require 'api_constraints'... | <p>You can try it:</p>
<pre><code>namespace :api, defaults: { format: :json }, constraints: { subdomain: 'api' }, path: "" do
namespace :v1, path: "" do
jsonapi_resources :subscriptions
end
end
</code></pre>
|
Track user location through mobile number <p>I want to create an application, when I enter any mobile number it should give me current location of that number.
Guys please help me if it is possible then tell me how it is possible ?</p>
| <p>you cant get the location from cell number !!!!!</p>
<p>though there are some applications in some countries which they do something like this but the mechanism is different.</p>
<p>how they work is, user registers in their app and they use Cell Number as username for registering users. then this way they can tell... |
Python: Insert into a postGreSQL table using python by passing parameters <p>I have two lists:</p>
<pre><code>columns = ['id','name','address']
data = ['1,'John','LA'','2,'Jessica','TX'']
</code></pre>
<p>I have a table schema with the same columns as above and I am unable to insert data into the table using psycopg2... | <p><code>INSERT</code> needs columns and values in <code>()</code> so you need <code>INSERT INTO test (%s) VALUES (%s)</code></p>
<p>see: <a href="http://www.w3schools.com/sql/sql_insert.asp" rel="nofollow">http://www.w3schools.com/sql/sql_insert.asp</a></p>
|
how to get prompt user input(set /p) under FOR /F Loop <p>I need to store the user input and store in a text file while under for /f loop sequence...</p>
<p>text1.txt(data)</p>
<pre><code>Title1
Title2
Title3
</code></pre>
<p>code:</p>
<pre><code>@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
for /F "delims=" %%a in (te... | <pre class="lang-dos prettyprint-override"><code>@echo off
setlocal enabledelayedexpansion
for /f "delims=" %%a in (text1.txt) do (
echo Group Name: %%a
set /p d1="Enter genre: "
echo.
echo %%a
echo !d1!
echo !d1!>>text2.txt
)
</code></pre>
<p><code>enabledelayedexpansion</code> is only h... |
Installing Text::Fuzzy in cygwin 64 bit version <p>I am currently working to develop a code which helps me to find a closest string match for a given string from a list of strings. I came across a Perl module Text::Fuzzy which helps me to do that. But i am working on cygwin and a having hard time installing it properly... | <pre><code>Can't exec "make": No such file or directory at /usr/lib/perl5/5.22/CPAN/Distribution.pm
</code></pre>
<p>This means that <code>make</code> is missing. You will have to install <code>make</code> to be able to install a Perl module.</p>
<p>Just do</p>
<pre><code>apt-get install build-essential
</code></pr... |
Adding gestures to a draggable view? Swift <p>I've got <code>buttons</code> on my <code>view</code> that are <code>draggable</code> using <code>touches</code> <strong>began/moved/ended</strong>.
I want to add a <code>tapped</code> and <code>doubletapped</code> actions for my <code>buttons</code>. Once I switch my butto... | <p>First of all you have to implement <code>UITapGestureRecogizer</code> delegate in your class and add following line of code.</p>
<pre><code>let tap = UITapGestureRecognizer(target: self, action: "handleTap:")
tap.delegate = self
tap.numberOfTapsRequired = 1
yourButton.addGestureRecognizer(tap)
</code></pre>
<p>Hop... |
Comparing Xml by values of nodes or attributes in C# <p>I want to compare two (or more) XMLs files by values of nodes or attributes. I am not interested by node names or attributes.</p>
<p>Searching on google i found XMLDiff Patch ( <a href="http://msdn.microsoft.com/en-us/library/aa302294.aspx" rel="nofollow">http://... | <p>If you want to do it your self and the structure of the xml documents is known and constant you could maybe do something like this (supposing that xdocB is the valid document):</p>
<pre><code>class NodeComparer : IEqualityComparer<XmlNode>
{
public bool Equals(XmlNode x, XmlNode y)
{
if (x == null || ... |
Teradata parser issue <p>I am trying to execute the below query but I get the error </p>
<pre><code>INSERT INTO TABLEA(
CUSTOMER_CT_KEY,
CUSTOMER_ST_KEY,
CUSTOMER_TEST_KEY,
JAN_AMT,
FEB_AMT,
MAR_AMT)
SELECT
A.CUSTOMER_CT_KEY,
A.CUSTOMER_ST_KEY,
A.CUSTOMER_TEST_KEY,
SUM(CASE WHEN EXTRACT(MONTH FROM A.DATECOL) = '01'
... | <p>If you get an error like this you should open an incident with Teradata support. This is from the <em>Messages</em> manual:</p>
<pre><code>3899 Internal error in the Teradata SQL Parser.
Explanation: The Teradata SQL Parser erred.
Generated By: CON, LEX, PAR, SYN, RES and OPT modules.
For Whom: System Support Repre... |
Visual Studio: SSRS how to avoid dublicate textbox names on copying table <p>I am having an annoying problem, when ever I copy a table and paste the table in the same report almost all the textboxes will be named similarly <strong>textbox1</strong> and the copy: <strong>Textbox1</strong></p>
<p>This causes the report ... | <p>This looks like a bug. I think:</p>
<ul>
<li><p>SSRS is not case-sensitive, while visual studio is. </p></li>
<li><p><s>Problem happens when the report created in older VS is opened in newer VS with different naming convention.</s></p></li>
</ul>
<p>Workaround:</p>
<ul>
<li><p>check which format the new duplicate... |
website is not accessable (through www on some system) while accessable through ip address on all system <p>I have a go-Daddy hosting account and this is the site where i am working:-</p>
<p>(<a href="http://www.epcgroup.net/" rel="nofollow">http://www.epcgroup.net/</a>)</p>
<p><strong>Problem is:</strong>- when i tr... | <p>DNS isn't fully propagated yet - <a href="https://www.whatsmydns.net/#A/www.epcgroup.net" rel="nofollow">https://www.whatsmydns.net/#A/www.epcgroup.net</a>.</p>
<p>Try again shortly.</p>
|
how to use PMCMD command in UNIX <p>how to use <strong>pmcmd</strong> command in UNIX script. am not able to execute directly in shell script it is not executing.</p>
| <p>First you should set the informatica bin directory in PATH and LD_LIBRARY_PATH in .bashrc as below</p>
<pre><code>PATH=/<YourInformaticaHome>/server/bin:$PATH
export PATH
LD_LIBRARY_PATH=/<YourInformaticaHome>/server/bin: $LD_LIBRARY_PATH
export LD_LIBRARY_PATH
</code></pre>
<p>Then you could run ... |
How to declare embedded body parameters in swagger yaml format <p>I have a sample request input with the nested post parameters in JSON which looks like below. I have to know use this data to create definition in YAML format but I have no idea how to do this.</p>
<p>I have read the swagger docs but still can't crack... | <p>A good example is the <code>Pet</code> object defined in <a href="https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml#L654" rel="nofollow">petstore.yaml</a>, which contains 2 objects as the properties: <code>category</code>, <code>tags</code></p>
<... |
Multiple Filter using jquery with data attribute <p>I need to use multiple filters using <code>data</code> attributes. It's working in combination but not working alone. Here is my code:</p>
<pre><code><ul>
<li>
<div class="sts">
<h1>filter 1</h1>
</... | <p>Your logic is <em>a lot</em> more complicated than it needs to be. You should look in to using DRY principles as you can make this much more simple.</p>
<p>First, put a common class on all the checkboxes (I used <code>.stat</code> in my example). Then use a data attribute to denote the type of the stat. From there ... |
Swift Animations - Perform a sequence <p>I'm not entirely sure how to perform a sequence of animations. If I try this it normally skips to the last one in the function.</p>
<p>Let's say I want to move 2 <code>UIImageView</code> (side-by-side) 300 points upwards,
then 2 <code>UILabel</code> (below the <code>UIImageVie... | <p>This is the way I have been using it. It is just a basic concept but you will get an idea. For my case I was using it with constants.</p>
<pre><code>UIView.animate(withDuration: duration, animations: {
// Your changes to the UI, eg. moving UIImageView up 300 points
}) { (success) in
// This execut... |
How to make Edit Text hint appear when typing <p>I would like for my app to be able to display different hints in the edittext at different times, so i have to set the hint pro-grammatically at each times as below.</p>
<pre><code>editText.setHint("Hint 1");
</code></pre>
<p>But the problem is when i starts typing the... | <p>Either you should consider to change to <a href="https://developer.android.com/reference/android/support/design/widget/TextInputLayout.html" rel="nofollow">TextInputLayout</a>(Strongly recommended this. <a href="https://guides.codepath.com/android/Working-with-the-EditText#displaying-floating-label-feedback" rel="no... |
Conditionally use custom middleware <p>I created my custom authentication middleware in asp. net core project, and registered it as shown below:</p>
<pre><code>public class MyAuthenticationMidleware
{
private readonly RequestDelegate _next;
public ConnectAuthenticationMidleware(RequestDelegate next)
{
... | <p><code>MapWhen</code> is used to seperate middleware pipeline. If you want to use mvc for branced pipeline you need to add separetely. So you should use <code>.UseMvc();</code> in extension method like below: </p>
<pre><code>public static IApplicationBuilder UseMyAuthenticationWhen(this IApplicationBuilder builder, ... |
how can I convert jquery jtable into html table. <p>how can I convert jquery jtable into html table. So that I can use javascript to specified row or column. It creates html table automatically, but I can't find it.</p>
<p>here is my jsp file:-</p>
<pre><code><!DOCTYPE html>
<html>
<head>
<title&... | <p>AFAIK, there's no official method to convert jTable to ordinary html table.
But using unofficial way, you can get the table string content like this:</p>
<blockquote>
<p><code>$("#StatusContainer").data("hikJtable")._$table</code></p>
</blockquote>
|
Log Monitoring of Multiple Computers with Email Notification - Filter by EventID <p>I have this PowerShell code below that gathers eventlogs from a list of computers and then sends email to the recipients. </p>
<p>What i do need is for it to look for specific set of event id and not search for all events. Then if it s... | <p>You could try putting an ID parameter into your Filter Hashtable then use an <code>If-Else</code> statement to turn the Id search on and off. Create your text file like soon:</p>
<p><strong>servers.txt</strong></p>
<pre><code>SERVERNAME1;11,65,73
SERVERNAME2;1
SERVERNAME3;1,2,3,4,5
SERVERNAME4;
SERVERNAME5;
SERVER... |
Change RecyclerView's Layout on orientation change <p>I'm having <code>RecyclerView</code> with <code>GridLayoutManager</code>. I'm displaying Single Column for landscape and Seven Columns for landscape.
Using:</p>
<pre><code> @Override
public void onConfigurationChanged(Configuration newConfig)
{
rec... | <p>Here is the solution for this, Pass one Flag to you <code>Adapter</code> which describe current orientation.</p>
<pre><code>@Override
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
//Update the Flag here
orientationLand = (newConfig.orientation == ... |
Celery - [Errno 111] Connection refused when celery task is triggered using delay() <p>I have two application servers(both having the django application). Both have celery worker running. RabbitMQ server is set up on a third different server.</p>
<p>When any of the test task is being executed from any of the two appli... | <p>I'd say start adding some extra logging calls before calling delay on server2 just to make sure your celery config is correct when running it as a webserver (as opposed to the manage.py shell instance). It sounds like some startup script for gunicorn / uwsgi / apache / magic isn't loading some variable needed to act... |
Split google search address <p>I need to split my address (city and street) from google search bar. I will explain better with the pictures.</p>
<p>Here is picture how google find the address.
<a href="http://i.stack.imgur.com/pQnBP.png" rel="nofollow"><img src="http://i.stack.imgur.com/pQnBP.png" alt="enter image des... | <p>Since you receive location name and city name as different spans, but separated by <code>,</code> using css (probably, as I do not see it in html), just append <code>,</code> to location name:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-c... |
Bad exit status from /var/tmp/rpm-tmp.a5Y4NP (%build) <p>I am trying to build a simple source rpm package for nginx (nginx-1.11.4-1.el6.ngx.src.rpm). But i am not able to build as its giving me errors. I have already followed these two threads.. Bad exit status from /var/tmp/rpm-tmp.b1DgAt (%build) and Bad exit status ... | <p>Examine the file ... you can run with "sh -x /var/tmp/rpm-tmp.xxxxxx" if necessary.</p>
<p>You may need to rebuild the binary package to fix the problem.</p>
|
Encoded string in every php files, It is like malicious virus <p>In my every php file I have below code.</p>
<p>Is this a malware?</p>
<p><a href="https://snag.gy/2rfdlH.jpg" rel="nofollow">click here to view image</a></p>
| <p>You have been hacked. Delete all. Restore from backup. Patch as required. Change all passwords.</p>
|
Filling and Styling D3 Tree nodes based off of data <p>stuck on styling the Collapsible Tree example found at </p>
<p>D3 Code: <a href="https://bl.ocks.org/mbostock/4339083" rel="nofollow">https://bl.ocks.org/mbostock/4339083</a></p>
<p>JSON: <a href="https://bl.ocks.org/mbostock/4339083" rel="nofollow">https://bl.oc... | <p>I'm not sure what do you really need, but I think you added a property <code>status</code> to you json object and according to its value you are giving a different circles color to the corresponding element.</p>
<blockquote>
<ol>
<li>entertain a third condition (i.e. a negative number)</li>
</ol>
</blockquote... |
How to call didSet without changing property value <p>I need the code in <code>didSet</code> to be executed without changing the property's value.</p>
<p>Coming from Objective-C recently, there doesn't seem to be a <code>setMyProperty()</code>.</p>
<p>So I tried:</p>
<pre><code>self.myProperty = self.myProperty
</co... | <p>You could do:</p>
<pre><code>struct MyStruct {
var myProperty: CGFloat {
didSet {
myFunc()
}
}
func myFunc() { ... }
}
</code></pre>
<p>Here <code>myFunc</code> will be called when <code>myProperty</code> is set. You can also call <code>myFunc</code> directly, such as in th... |
40+ clients on home router + repeater, but the communication fails after a few hours <p>I have around 43 Embedded devices(2.4GHz band) connected to home router(Netgear N300). What I have found is that my Netgear router does not allow more than 32 DHCP clients to connect. Hence I put a repeater(Dlink DIR 816, dual anten... | <p>So you're sending 43 <code>alive</code> packets over TCP via Wi-Fi <em>per second</em> using a $40 router. TCP transmission implies unicast delivery with acknowledgements - over wifi, 43 times per second. It makes me think the Wi-Fi access point hardware is the weakest point here (let alone that 43 devices is just t... |
How to display sharepoint library in gridview using c# <p>I have created a sharepoint library and also enabled the ratings option.</p>
<p>So whenever end users go through the documents they can rate on it ( I have taken Rating stars)</p>
<p>Now I want to display that library using C# and the rating column should be e... | <p>You can build a custom web part in visual studio and you need Office Developer Tools for SharePoint, you can check it here <a href="https://msdn.microsoft.com/en-us/library/office/jj220049.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/office/jj220049.aspx</a></p>
<p>Now, you have your development en... |
multiple blocks in template <p>How can I declare a region in the template to use in other template files?</p>
<p>Basically, I want 2 regions in my template to use for <code>container</code> and <code>container-fluid</code> classes of bootstrap.</p>
<p>Right now i declare a div with <code>container</code> class in the... | <p>Using loop.php in child themes
Assuming the theme folder is wp-content/themes, that the parent theme is twentyten, and the child theme is twentytenchild, then the following code â</p>
<pre><code><?php get_template_part( 'loop', 'index' ); ?>
</code></pre>
<p>will do a PHP require() for the first file that ... |
Getting syntax error using javascript some method <p>I am getting one error. I am using javascript some method to reject some duplicate value but getting syntax error.I am explaining my code below.</p>
<pre class="lang-js prettyprint-override"><code>var outputList = [];
for (var i = 0; i < specialImages[0]['special... | <p>Maybe your user agent does not support arrow functions.</p>
<p>Replace arrow function</p>
<pre><code>if (!outputList.some(x => x.image === specialImages[0]['special'][i].image)) {
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
</code></pre>
<p>with classic function</p>
<pre><code>i... |
Forcing an img to fit into a div which is a flex element <p>I have a div whose height is defined by a <code>flex</code> display on a enclosing div.
The purpose is to display an image in this div.</p>
<p>My HTML5 code is :</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="fal... | <p>Just give the image a <code>width:100%;</code> <strong>without</strong> <code>height: 100%;</code>. This way, it will fit perfectly into the containers width while keeping its aspect ratio, even while resizing the viewport. Just giving <code>height: 100%;</code> will force an image with landscape orientation to over... |
converting % symbol to string in vba <p>My Question is simple:
all I want to do is add the "%" symbol to a cell that contains numerical data.
Here is the code that I wrote:</p>
<pre><code>Private Sub CommandButton21_Click()
With Range("B11")
.Select
.Value = [B11] & ChrW(U + 37)
End With
End Sub
</code... | <p>Use <code>Cells(1, 5).NumberFormat = "0.00%"</code>, <code>Range("B11").NumberFormat = "0.00%"</code> or <code>[B11].NumberFormat = "0.00%"</code> to change formatting of a cell instead of trying to add character to a number. You might need to change the 0.00 to any other formatting type that suits your need.</p>
<... |
How to convert uuid v4 of php into two 64 bit integers <p>Example:
Uuid generated from v4 of php :
<code>8bc278cb-2fb6-413b-add6-8ba39bf830e8</code></p>
<p>I want to convert this into two 64 bit integers. </p>
<p>I've tried using <code>hexdec</code> of php but it's return value is of numbers. I want datatype intege... | <p>UUID is a 128bit data type. Excluding the 6 reserved bits, there are 122 data bits in it. Makes it impossible to fully convert any UUID to a 64bit integer. You'll at least need to store it as 2 64bit numbers or 4 32bit numbers.</p>
<p>You can unpack the UUID into binary, then unpack it as 4 32bit unsigned character... |
Angular new changes not reflecting <p>I am building a new project using angularjs and PHP(codeigniter).
I am facing an issue with the content or changes I make on both client-and serverside, but the changes are not being reflected. </p>
<p>Does this have something to do with the cache?</p>
| <p>The browser uses template caching, which should be cleared upon making changes to templates. See <a href="http://stackoverflow.com/questions/33040730/browser-does-not-detect-changes-in-angularjs">this question</a>. You can do the following to make your life easier when developing:</p>
<h2>Reload the page with clear... |
How to get similar string by comparing two strings arrays? <p>I want to compare two string array like the following..</p>
<pre><code>var array1 = ["playing cricket", "Reading Books", "Flying"]
var array2 = ["cricket", "Books"]
var array3 = ["common hobbies will insert here"]
</code></pre>
<p>so here I get common ho... | <p><a href="https://jsfiddle.net/5e09ym3o/1/" rel="nofollow"><strong>Fiddle</strong></a></p>
<p>Try something like</p>
<pre><code>for (i = 0; i < array2.length; i++) {
for (j = 0; j < array1.length; j++) {
if (array1[j].toLowerCase().indexOf(array2[i].toLowerCase()) != -1) {
... |
Not outputting the calculation, just 0 <p>I have my code here and it runs, however, when I try to output the percentage it just outputs 0, I've spent a long time trying to figure out what I'm missing and I'm clueless. Basically I'm trying to output the percent of votes for each candidate out of total votes. Any help wo... | <p>The coefficient <code>amountOfVotes[i] / total</code> in <code>(amountOfVotes[i] / total) * 100.0</code> is evalated in <em>integer arithmetic</em>: i.e. any fraction is discarded.</p>
<p>So you end up with <code>0 * 100</code> for all cases where <code>amountOfVotes[i]</code> is less than <code>total</code>.</p>
... |
OAuth1.0 with php and CURL not working <ul>
<li>I am trying to hit api which is having OAuth1.0. </li>
<li>Problem is when i am trying with Postman i am getting response but with PHP curl its giving error.</li>
<li><p>In postman i am passing parameters as below</p>
<p>url='xxxx', Authentication stuff is type=OAuth1.0,... | <p>You are using wrong approach . please View This Article</p>
<p><a href="http://developer.gettyimages.com/forum/read/184531" rel="nofollow">http://developer.gettyimages.com/forum/read/184531</a></p>
|
how can we convert word to .pdf format and excel to .pdf format from c# <p>How can we convert the excel file and word file to .pdf format from c#. i tried the following code but it shows the an error</p>
<p>this is my code: </p>
<pre><code> Microsoft.Office.Interop.Word.Application appWord = new Microsoft.... | <p>While not directly related the documentation under
<a href="https://msdn.microsoft.com/en-us/library/office/ff198122.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/office/ff198122.aspx</a></p>
<p>gives a note, that if the pdf add-in is not installed, exactly this error will occur. So check your prere... |
Android Studio - set build directory globally (per machine) <p>I can set the build directory manually like following for example:</p>
<pre><code>allprojects {
buildDir = "C:/tmp/${rootProject.name}/${project.name}"
}
</code></pre>
<p>This can be done in my project's <code>build.gradle</code>. I want to change thi... | <p>create a file camed "gradle.properties" set your desired properties in it and put it in ".gradle" folder (where your gradle is installed)</p>
<p>in linux ".gradle" is normally in "/home/[]your_user_name]/.gradle"</p>
<p>then in android view of project structure of all your project this file will appear with the n... |
Android camera2: what kind of upsampling/downsampling is done to fit my streams? <p>I want to get image flows with the least distortions possible(no noise reduction, etc) without having to deal with RAW outputs.
I'm working with two streams(one when using the deprecated <code>camera</code>), one for the preview and on... | <p>The scaling algorithm used depends on the device; generally for power efficiency and speed, scaling is done in hardware blocks usually at the end of camera image signal processor (ISP) pipeline.</p>
<p>Therefore, you can't generally rely on it being any particular kind of scaling or filtering. Unfortunately, if yo... |
How to replace a value in specific cell of a csv file? <p>I want to make a python script which has a counter that replaces the current value of a specific cell in a CSV file. </p>
<p>My code is : </p>
<pre><code>with open(ctlLst[-1], 'rb') as csvfile:
csvReader = csv.reader(csvfile)
csvReader.next()
for r... | <p>Most probably it's a good idea to write while reading/parsing to save memory</p>
<pre><code>with open('out.csv', 'wb') as outfile:
with open(ctlLst[-1], 'rb') as csvfile:
csvReader = csv.reader(csvfile)
csvWriter = csv.writer(outfile)
csvReader.next()
for row in csvReader:
row[6] = int(row[6... |
Read json with Retrofit - android? <p>How can I read bellow format <code>json</code> with <code>Retrofit</code> ?</p>
<pre><code>{"Key":null,"Response":1}
</code></pre>
<p><strong>NOTICE</strong> </p>
<p>I am using :</p>
<pre><code>compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.google.code.gson:gson:2.6.1... | <blockquote>
<p>{"Key":null,"Response":1}</p>
</blockquote>
<p>use this POJO class of above json ....</p>
<pre><code>public class Result {
@SerializedName("Key")
@Expose
private Object key;
@SerializedName("Response")
@Expose
private Integer response;
/**
*
* @return
* The key
*/
public Object getKey() {
return ... |
How to get all anchor tag data in this string <p>I have below string and I want to fetch all anchor tag text from this string upto next row occur. </p>
<p>Currently it only returns first anchor tag.</p>
<pre><code>$string = '<div class="row mb-xlg"><div class="col-md-12"><div class="heading heading-bor... | <p>Try with this :</p>
<p>First Reduce it to your expected group by this regex: </p>
<pre><code>$reInitial='/<div class=\"row(?:((?!row).)*)(.*?)<div class=\"row\"/';
</code></pre>
<p>Then capture your result from here:</p>
<pre><code>$reFinal = '/<a(?:.*?)>(.*?)<\/a>/';
</code></pre>
<p>Code Sni... |
pgadmin4 command keep running and process watcher won't go away <p>I was trying to follow the instructions from <a href="http://www.postgresqltutorial.com/load-postgresql-sample-database/" rel="nofollow">postgresqltutorial</a> to load a sample database into postgresql using pgadmin. But after the database was restored(... | <p>This is a bug in pgAdmin4 & reported,
<a href="https://redmine.postgresql.org/issues/1679" rel="nofollow">https://redmine.postgresql.org/issues/1679</a></p>
|
How to delete session data when page refresh in Laravel5? <p>I made mail send program with Laravel5, that works so well.</p>
<pre><code>public function sendMail(Request $request){
$data = session() -> all();
// send mail to User and Admin
Mail::send(['text' => 'test.mailtouser'], $data, function($me... | <p>Thanks Everyone.
Sorry it is too late to answer this question like a turtle.
Finally, I solved with this.</p>
<pre><code> public function sendMail(Request $request){
$data = session() -> all();
// send mail to User and Admin
Mail::send(['text' => 'test.mailtouser'], $data, function($message) u... |
angular2 traceur not found <p>I import in angular2 some module and have error. traceur not found. Example angular2-google-maps
system.config.js</p>
<pre><code>var map = {
...
'angular2-google-maps/core': 'node_modules/angular2-google-maps/src/core',
...
};
var packages = {
'angular2-google-maps/core': {
main: '... | <p>As you can see on the <a href="http://plnkr.co/edit/YX7W20?p=preview" rel="nofollow">demo plunker</a>, You have to import the umd file to get it working properly. Importing the <code>TS</code> files will never work, because your browser doesn't want <code>typescript</code>, it wants <code>Javascript</code> ones.</p>... |
PDFView setNeedsDisplay:YES doesn't work on MacOS Sierra 10.12 <p>I have use <code>[PDFView setNeedsDisplay:YES]</code> to let the PDF view redraw, and it worked great on OSX 10.9-10.11.
However it doesn't work unless I zoom in or zoom out the PDF page... </p>
<p>Is there any other way to redraw immediately? Code be... | <p>I'm having the same trouble. The first time I add an annotation, <code>PDFView</code> displays that annotation on the page immediately. From then on, adding or removing an annotation works fine in code but <code>PDFView</code> doesn't show the change until I manually scroll the view.</p>
<p>From <code>PDFKit</code>... |
Connection error while deploying Cassandra v2.2.8 in Bluemix <p>I have created an IBM container with Cassandra v2.2.8 on Bluemix. When starting it, I get the following error:</p>
<pre><code>TINFO 09:20:56 DiskAccessMode 'auto' determined to be
mmap, indexAccessMode is mmap
FINFO 09:20:56 Global memtable on-heap ... | <p>It looks like you will need to set an environment variable for CASSANDRA_LISTEN_ADDRESS and possibly CASSANDRA_BROADCAST_ADDRESS.</p>
<p>I'm not sure if you can get away with just setting 127.0.0.1 (I haven't used cassandra before), but if you can't, the best thing to do would be to request an IP address before dep... |
How does DataStax Spark Cassandra connector create SparkContext? <p>I have run the following Spark test program successfully. In this program I notice the "cassandraTable" method and "getOrCreate" method in SparkContext class. But I am not able to find it in the Spark Scala API docs for this class. What am I missing in... | <p>It is not different. Spark supports only one active <code>SparkContext</code> and <code>getOrCreate</code> is a method defined on <a href="https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.SparkContext$" rel="nofollow">the companion object</a>:</p>
<blockquote>
<p>This function may be use... |
Drag and drop multiple items in Qml <p>I need to draw bunch of Rectangles in my application. The user should be able to select each of them individually and move them freely and change their position. The user also should be able to select multiple Rectangles and move all the selected one simultaneously and release the... | <p>I didn't manage to have your code working. First, I see mistakes on it:</p>
<pre><code>Rectangle {
id: box
parent: mainGrid
...
}
</code></pre>
<p>you just need to remove the parent <code>Item</code> which is of no use, and set the <code>Rectangle</code> as root of the delegate.</p>
<p>Then, you forgot to... |
Docker cpu shares and garant minimum allocated CPU for container <p>I develop a application which runs in three containers on my development box with a quadcore with hyperthreading, meaning there are 8 cores to be used by the system and docker.</p>
<p>Thy CPU allocation for the containers is done by docker-compose as ... | <p>With Docker for Mac your containers are all running in a HyperKit VM. The VM has an allocation of CPU and memory which is a subset of the total on your Mac.</p>
<p>You can change the allocation in <a href="https://docs.docker.com/docker-for-mac/#/preferences" rel="nofollow">Preferences</a> - by default the Docker V... |
Get a list of views inside a ListView in NativeScript? <p>I know I can get the first element with a matching ID using the <code>@ViewChild</code> component. If I have a <code>GridLayout</code> inside the item template for a <code>ListView</code> (i.e. each item in the list has its own <code>GridLayout</code>), how do I... | <p>I did not try it. </p>
<p>This code seems getting child label by Id. So you can apply Id to each child view then get them by Id.</p>
<p><a href="http://fluentreports.com/blog/?p=224" rel="nofollow">http://fluentreports.com/blog/?p=224</a></p>
|
Can I upload tools.jar on Maven Central? <p>My application uses the JDI debugger classes, which are in <code>tools.jar</code>. I want the application to be packaged as standalone using <code>Maven</code> (ie creating a <code>foo-with-dependencies.jar</code>).</p>
<p>However, <code>tools.jar</code> is not on Maven Cent... | <blockquote>
<p>Only releases can be uploaded to the central repository, that means files that won't change and that only depend on other files already released and available in the repository.</p>
<p>There are some requirements for the minimal information in the POMs that are in the central repository. The upda... |
inserting only one row of each loop in jdbc using java <p>I have a two tables, where i need to loop for each client with specific batches and update to another table. below is my code</p>
<pre><code>client Table
----------
client_id
1
2
3
batch_meta_data_id Table
------------
client_id batch_id
1 12
1 ... | <p>In this code</p>
<pre><code>while(rs1.next()){
if(rs1.next()){
</code></pre>
<p>You are incrementing twice</p>
<p>see</p>
<p><a href="https://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html#next()" rel="nofollow">https://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html#next()</a></p>
|
std::unordered_map pointers/reference invalidation <p>I have the following code: </p>
<pre><code>std::unordered_map<std::string, std::string> map;
map["k1"] = "v1";
auto& v1 = map["k1"];
map["k2"] = "v2";
</code></pre>
<p>After reading <a href="http://en.cppreference.com/w/cpp/container/unordered_map" rel=... | <blockquote>
<p>It looks like v1 can be safely used after inserting new values, even if re-hashing might occur during insertion. </p>
</blockquote>
<p>Yes, <a href="http://en.cppreference.com/w/cpp/container/unordered_map/operator_at" rel="nofollow">std::unordered_map::operator[]</a> doesn't invalidate references, e... |
Abstract Class for Doctrine entity <p>I am trying to make an abstract class for my entities involving general fields like <code>created_at</code> and <code>updated_at</code> values:</p>
<pre><code><?php
namespace AppBundle;
use Doctrine\ORM;
abstract class Model {
/**
* @var \DateTime $created_at
*... | <p>The problem is likely to be that your properties in the abstract parent class are defined as <code>private</code>. Change them to <code>protected</code> and it should work.</p>
<p>As an aside, I use traits for this purpose, rather than inheritance, as your entity classes can use multiple traits, but they can only ... |
How to test only specific http request method available for controller method in Spring MVC? <p>I need to check if only specific http method is available for some url.
For example, if there is a controller like this</p>
<pre><code>@Controller
public class FooController {
@RequestMapping(value = "bar", method = Req... | <p>You would need to check the status of all the request methods, you could do it using <code>andExpect</code> with <code>status().isMethodNotAllowed()</code> or <code>status().isNotFound()</code> depends on your needs: </p>
<p>Examples:</p>
<ul>
<li><strong>get</strong>: <code>mockMvc.perform(get("bar").andExpect... |
Error during only Debug of program. (In dll of Oculus HMD) <p>I am using Oculus World Demo.
I can start it manually, but I have an internal error during "Debug"/"Release".</p>
<p>How to debug such errors?</p>
<p>Where can I see the command which runs the program.</p>
<p>Again:
It runs normally when I click on MyGre... | <p>It could be useful if you say in what line the program crash. </p>
<p>Anyway you can use the Oculus Debug Tool: <a href="https://developer3.oculus.com/documentation/pcsdk/latest/concepts/dg-debug-tool/" rel="nofollow">https://developer3.oculus.com/documentation/pcsdk/latest/concepts/dg-debug-tool/</a></p>
<p>To re... |
Problems with Pom.xml <p>I hope you guys can help me out.
I want to make a simple webLogin (Maven project) so far my code works. Now to make a build and deploy it i had to look into poms and i really tried but i don't know what i am doing wrong. Maybe someone knows how to do it right</p>
<p>My project tree:</p>
<p><... | <p>Your project structure seems to be broken. You usually have <em>one</em> pom per project, and especially you should not have pom files in the src/main/java. If you want to define modules (subprojects) they need to have their own inner structure (as every Maven project).</p>
|
Increment slice object? <p>Is it possible to change the values in a python slice object?</p>
<p>For example, if I have </p>
<pre><code>slice(0,1,None)
</code></pre>
<p>How would I, in effect, add 1 to the start and end values and so convert this to:</p>
<pre><code>slice(1,2,None)
</code></pre>
| <p>Not exactly elegant, but it works:</p>
<pre><code>>>> s1 = slice(0,1,None)
>>> s2 = slice(s1.start + 1, s1.stop + 1, s1.step)
>>> s2
slice(1, 2, None)
>>>
</code></pre>
|
JButton not invoking actionPerformed on any subsequent click in same GUI instance <p>I have a JButton that will not allow me to perform the same action on any subsequent click on it after the first in the same Swing GUI instance.</p>
<pre><code> JButton Run = new JButton("Run");
Run.setLocation(290, 70);
Ru... | <p>At first glance, the <code>JUnitCore.runClasses(Run.class);</code> call is suspicous. Also, it would be good to know what does the <code>errorMessageDisplay()</code> do. I believe, the problem is with one of these methods.</p>
<p>You can verify this with the following experimental code. Just be careful not to push ... |
AspnetCore datacontract serialize in json with the name namespace of the keys of my dictionnary <p>I try to send and Dictionnary.
This is the structure of my DIctionnary : </p>
<p><code>var gridsAndCountriesByShipper = new Dictionary<Organisation, List<Grid>>();</code></p>
<p>And this is the class wich t... | <p>Your <code>Organisation</code> doesn't override <code>ToString()</code> method and the default behavior is to return the class name with namespace</p>
|
Unlucky number 13 <p>I came accorss this problem <a href="http://qa.geeksforgeeks.org/4344/the-unlucky-13" rel="nofollow">Unlucky number 13! </a> recently but could not think of efficient solution this.</p>
<h3>Problem statement :</h3>
<p>N is taken as input. </p>
<blockquote>
<p>N can be very large 0<= N <=... | <p>I get the feeling that this question is designed with the expectation that you would initially instinctively do it the way you have. However, I believe there's a slightly different approach that would be faster.</p>
<p>You can produce all the numbers that contain the number 13 yourself, without having to loop throu... |
Access Constructor parameter in Method with Typescript <p>My Typescript Class contains the method <code>getProductAttributeByName(name: string)</code> which filters the collection defined as parameter of the constructor.</p>
<pre><code>class Product {
id: string;
constructor(productDto: IProductDto) {
... | <p><em>"Just because my method cannot access a constructor parameterâ¦"</em> is thinking about this in the wrong terms. When instantiating your class, is <code>productDto</code> an important state of your instance? Does the data in <code>productDto</code> hold important information that <code>Product</code> needs duri... |
Java fx gluon mobile <p>I try to launch Gradle task <code>createIpa</code> from my project but I have this error:</p>
<pre><code>Execution failed for task ':createIpa'.
org.apache.commons.exec.ExecuteException: Command '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -o /... | <p>It has probably nothing to do with Gradle.</p>
<p>Run the same command outside Gradle to see if you can reproduce the error and see in more detail what went wrong. </p>
|
Deploying/packaging subsets of Django apps <p>We have a Django 1.10 project consisting of 7 apps (let's call them A-G).
The project is actually three different servers consisting of different subsets of the apps like this: A+F, A+G, A+B+C+D+E. <BR>F and G are not referencing or referenced by any other app except for A.... | <p>Sounds like the right⢠thing to do is to package each app <code>{A,B,C,D,E,F,G}</code> separately, i.e. a completely standalone version control repository, it's own <code>setup.py</code> and all, and then have each of your 3 'servers' be projects in their own right, each of which install the relevant dependencies ... |
c# linq to sql - updating database table <p>I'm wondering is this a bad concept of usage linq to sql to update item in my database, what I am doing is: I'm changing status of my selected item (talking about orders) from 0 to 1 and it looks like this (current code):</p>
<p>Method I'm calling to <strong>set/change</stro... | <p>Maybe take a look at this post: <a href="https://stackoverflow.com/questions/39831093/linq-to-sql-submit-changes-or-refreshsystem-data-linq-refreshmode-overwrite">Linq to sql submit changes () or .Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, "entity to update")</a></p>
<p>Basically whats b... |
WPF XAML pass to ConverterParameter array of enums <p>I have enum </p>
<pre><code>public enum DocumentTypes
{
First, Second, Third, Fourth
}
</code></pre>
<p>How to pass values of <code>enum</code> to <code><sys:Enum></sys:Enum></code></p>
<pre><code>xmlns="http://schemas.microsoft.com/winfx/2006/xam... | <p>Do this : </p>
<pre><code> <x:Array Type="{x:Type sys:Enum}">
<local:DocumentTypes>First</local:DocumentTypes>
<local:DocumentTypes>Second</local:DocumentTypes>
<local:DocumentTypes>Third</local:DocumentTypes>
</x:Array>
</code></pre>
|
Access just the current BuildConfiguration in a vNext Build Definition <p>Here is the setup:
I have a vNext Build Definition that I have set "Multi-configuration" to true and am using the Variable "BuildConfiguration".</p>
<pre><code>BuildConfiguration = QA, UAT, Live
</code></pre>
<p>When the code is checked in, I g... | <p>I could reproduce your scenario. Unlike Release that have multiple environment, in Build, although we have selected Multi-configuration, it's still in a single build, so you only can get one build name. </p>
<p><a href="http://i.stack.imgur.com/niIex.png" rel="nofollow"><img src="http://i.stack.imgur.com/niIex.png"... |
is there a way to ask NAT its IP address from a host connected to it? <p>I know I can do this by ask google what is my IP and similar services but I don't want to use third party services. I don't have administrative rights to the NAT. I'm looking for some kind of request or packet that I can send to my NAT it replies ... | <p>Okay i assume here that by NAT you mean the address on which all the traffic is routed. Here the case is NATing is done onto your router so all your devices will have an external ip that of your router. If you want to know the ip of the devices that is NATed onto your router for that there is no easy way but somehow... |
What is the difference of SelectList and Projection in Nhibernate? <p>As the title says.</p>
<p>(To me it looks like <code>SelectList</code> is a way to create projections without using the <code>Projections</code> method.)</p>
| <p>I would say that full explanation is in the doc:</p>
<blockquote>
<p>QueryOver allows arbitrary IProjection to be added (allowing private
properties to be projected). The Projections factory class also has
overloads to allow Lambda Expressions to be used:</p>
<pre><code>IList selection =
session.QueryOve... |
How is div height calculated from font size <p>Is there is a way to calculate automatic <code>div</code> height knowing contained font size and family? How does browser calculate this? Example:</p>
<pre><code><div style="font-size: 14px; font-family: courier">Text</div>
</code></pre>
<p>Above <code>div</c... | <p>I'm afraid the answer to your question is that it isn't straightforward.</p>
<p>For proportional fonts, the line height is either</p>
<ul>
<li><p>the value of the <code>line-height</code> property if it's set in absolute lengths.<br>
<code><div style="line-height:20px">Text</div></code> will be 20px hi... |
<amp-ad> advertisements not displaying <p>I am trying to serve my own AMP ads. I have code that was working a couple of weeks ago, but which has mysteriously stopped working. I've appended a trivial example here:</p>
<p>I can tell from the Chrome Developer Tools Network tab the the ad is successfully invoking remote.... | <p>Please try to assign a supported ad network in your <code>type</code> attribute.</p>
<p>In addition to that, <a href="https://www.ampproject.org/docs/reference/components/amp-ad" rel="nofollow">amp-ad documentation</a> states that:</p>
<blockquote>
<p>All <code>data-*</code> attributes on the tag are automatical... |
Change the background color of a div in angular <p>I would like to change the bg colour of div when clicked on that particular div.
The div is placed in a slider panel. For example, if I click Home, the slider gets hidden and the home panel opens up. Again when I open the slider, the bg colour should be retained to say... | <p>Your <code>ng-style</code> syntax is wrong.</p>
<p>It should be</p>
<pre><code>ng-style="{'background-color':'blue'}"
</code></pre>
<p>Please, note that <code>ng-class</code> take a css <code>class</code> not individual properties </p>
<pre><code><div ng-class="bgColor"></div>
</code></pre>
<p>CSS <... |
How To Control Looping HTML Table PHP <p>So, i've table like in picture
<a href="http://i.stack.imgur.com/ml4ax.png" rel="nofollow"><img src="http://i.stack.imgur.com/ml4ax.png" alt="enter image description here"></a></p>
<p>I want put looping row person on left side to singgle row select box on right side, like by c... | <p>My friend just help to fix my problem, </p>
<pre><code><table>
<tr>
<td>No.</td>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
<?php if(!empty($query)) { $number=1;$count=0; foreach($query as $row) { ?>
<?php if($count % 3 ==... |
What would be the best approach and tool to use to make one app for both Android and iOS? <p>I have a web app done with webapp2 framework with Google App Engine. I want to make a mobile application for it also.</p>
<p>What would be the best approach and tool to use to make one app for both Android and iOS?</p>
| <p>Now in market many more platform is available for build multi support app.</p>
<p>I have Experience with <a href="https://ionic.io/" rel="nofollow">IONIC</a> and <a href="https://www.xamarin.com/" rel="nofollow">XAMARIN</a> both For my opinion <strong>IONIC</strong> is best platform for build multiple support app f... |
Can I improve performance of a build server by switching from EBS to EFS storage? <p>I am wondering if I can obtain serious improvements in performance by reconfiguring our Jenkins build server to use EFS (AWS NFS implementation) instead of EBS disks.</p>
<p>While EFS is about 3x more expensive per gigabyte the real c... | <p>Here are my intermediary results of my attempt of using AWS EFS for storing Jenkins home directory (which includes the workspaces).</p>
<p>My mistake was that I missed this well hidden page about <a href="http://docs.aws.amazon.com/efs/latest/ug/performance.html#bursting" rel="nofollow">EFS performance</a> which I ... |
Autofac dispose order <p>I started using Autofac for DI in a project of mine and there's one thing about it I cannot get clear from documentation / googling (maybe I'm missing something).</p>
<p>According to <a href="http://docs.autofac.org/en/latest/lifetime/disposal.html" rel="nofollow">documentation</a>, when a con... | <p>You are right, each disposable component are disposed the reverse order they have been created. </p>
<p>Each <code>ILifetimeScope</code> have a <code>IDisposer</code> (<a href="https://github.com/autofac/Autofac/blob/41aa4dd2117c913fd244c2a09186db5867a12bf3/src/Autofac/Core/IDisposer.cs" rel="nofollow">disposer.cs<... |
Bootstrap left aligned images affecting text layout <p>I am using Twitter Bootstrap to build a basic WordPress theme. Everything is working fine apart from when it comes to including images aligned left with some text. My example is below...</p>
<pre><code><div class="entry-content">
<div>
&l... | <p>Try using the white-space property.</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-css lang-css prettyprint-override"><code>/* Latest compiled and minified CSS included as External Resource*/
/* Optional t... |
How to create borders for my country states,districts and cities <p>I created google map with border for country india and fill with color red and like that I want to create a state,district,city,mandal,village map contain borders of each one in india How can I crreate that map.Please help me</p>
| <p>you can find the good opportunies from google geo charts.</p>
<p><a href="https://developers.google.com/chart/interactive/docs/gallery/geochart" rel="nofollow">https://developers.google.com/chart/interactive/docs/gallery/geochart</a></p>
|
Http Basic AUTH Window not poping up <p>This is my code</p>
<pre><code>if (!($_SERVER['PHP_AUTH_USER'] == 'admin' && $_SERVER['PHP_AUTH_PW'] == 'admin')) {
header('WWW-Authenticate: Basic realm="Protected"');
header('HTTP/1.0 401 Unauthorized');
return new JsonResponse(array... | <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><?php
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/... |
Re-run for loop in R <p>I am trying to run a for loop.now some values return NA.I would like to re run the for loop only for the values that have results NA and not for all the values.below is what I am using right now.this re runs the for loop for all the values.</p>
<pre><code>while(df[2] == NA){
for(i in 1:nrow(df... | <pre><code>while(sum(is.na(df[2])>0){
for(i in which(is.na(df[2])){
#do something
}}
</code></pre>
|
Redirect to external URL with Lumen <p>how can I do an external redirect (and set header values) with Lumen? This is not working:</p>
<pre><code>return redirect()->away('http://www.away.com');
</code></pre>
| <p>Just</p>
<p><code>return redirect()->to('http://www.away.com');</code></p>
<p>or simply</p>
<p><code>return redirect('http://www.away.com');</code></p>
<p>should work.</p>
<hr>
<p>From the source of <code>redirect</code>:</p>
<pre><code> * @param string|null $to
* @param int $status
* @param arra... |
importing excel sheet into mysql table with php <p>I want to import the excel sheet data into mysql table with php but i am getting these errors someone please get me out from this.. please look on php code only ignore html stuff. </p>
<pre><code><?php
include ("connection.php");
if(isset($_POST["submit"])... | <p>There are libraries <code>excellibrary/php-excel-reader/excel_reader2.php</code> and <code>excellibrary/SpreadsheetReader.php</code></p>
<p>you can use these libraries to read your content and convert it into array.
Once you convert your spreadsheet data into an array, you can easily insert into database using iter... |
Retract entity with a certain db/txInstant set in Datomic? <p>I'd like to retract an entity and at the same time specify the <code>db/txInstant</code> attribute but I cannot get this to work. Retracting the entity looks like this (and this works):</p>
<pre><code>[[:db.fn/retractEntity [:person/email "jdoe@example.com"... | <p>txInstant as I understand it is the time that the transaction specifying the change, be it retraction or addition, happened. So If you where to succeed in doing this you are essentially saying to the transactior: </p>
<p>"Hey there transactor please create a transaction now that happened sometime other then now"</p... |
Find missing "empty" translation in Symfony project <p>While checking the logs of my Symfony 2.8 project I came across the following warnings:</p>
<pre><code>Translation not found.
Context: { "id": "", "domain": "messages", "locale": "de" }
Context: { "id": "form_cancel", "domain": "forms", "locale": "de" }
</code><... | <p>As explained in <a href="http://symfony.com/doc/current/translation/debug.html" rel="nofollow">the documentation</a>, you can use the console to find the missing translations:</p>
<pre><code>php bin/console debug:translation de AcmeDemoBundle --only-missing
</code></pre>
<p>You can also specify the domain you want... |
center many images on horizontally with jade and css <p>I know this question has been asked many times but no solutions worked for me. I tried <a href="http://stackoverflow.com/questions/11819417/css-center-two-images-in-css-side-by-side">this</a> solution but it didn't worked for me and just aligned the images on the ... | <p>That should do the job:</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-css lang-css prettyprint-override"><code>img{
width: 300px;
margin: 5px;
}
#images {
width: 100%;
display: flex;
align-i... |
Parse clock time in java 8 <p>I wonder is it possible to parse clock time hour:minute:second in Java 8?</p>
<p>e.g.</p>
<pre><code>final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss");
final String str = "12:22:10";
final LocalDateTime dateTime = LocalDateTime.parse(str, formatter);
</code></pr... | <p>Since you only have a time use the <a href="http://docs.oracle.com/javase/8/docs/api/java/time/LocalTime.html" rel="nofollow"><code>LocalTime</code></a> class:</p>
<pre><code>DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss");
String str = "12:22:10";
LocalTime time = LocalTime.parse(str, formatt... |
How to upgrade a laravel project to use angularjs? <p>I have a static Laravel Project and want to use Angular with it. How can I do that? Is there a step-by-step tutorial, because i'm not familiar with gulp, bower, etc. I found <a href="https://www.laravel-angular.io/#/" rel="nofollow">https://www.laravel-angular.io/#/... | <p>Just add and include angular library in your blade template, like any other javascript library and start using it.</p>
|
How to have a similar enum like below, but to have it configured dynamically rather than static? <p>I use the below static values enum as <code>repeatInterval</code> for <code>UILocalNotification</code>. Can this be made dynamic?</p>
<pre><code>// RepeatInterval
enum RepeatInterval : String, CustomStringConvertible {
... | <p>You can create the enum with all possible options what you have done and create a function which filters the allValues array based on user selection </p>
<pre><code>// RepeatInterval
enum RepeatInterval : String, CustomStringConvertible {
case Never = "Never"
case EveryMinute = "Every Minute"
case Every... |
HTML navbar links incorrectly <p>Still working with bootstrap and I have navigation problem.</p>
<p>When using: www.example.com/#partners I'm moving to the wrong part of the page but only in first usage. After refreshing/clicking again on the menu it's navigating correctly. Every other link is working correctly, the p... | <p>Got the answer!</p>
<p>Some div from the page had display: none in CSS on page load and somehow it was messing up the navigation. For now solved it by adding js:</p>
<pre><code>$("#some-link").click(function(){
$("#content-div").show();
});
</code></pre>
<p>Thanks for everyone who contributed!</p>
|
How to strip line breaks from BeautifulSoup get text method <p>I have a following output after scraping a web page</p>
<pre><code> text
Out[50]:
['\nAbsolute FreeBSD, 2nd Edition\n',
'\nAbsolute OpenBSD, 2nd Edition\n',
'\nAndroid Security Internals\n',
'\nApple Confidential 2.0\n',
'\nArduino Playground\n',
'\... | <p>Just like you would <a href="https://docs.python.org/3/library/stdtypes.html#str.strip" rel="nofollow"><code>strip</code></a> any other string:</p>
<pre><code>text = []
for name in web_text:
a = name.get_text().strip()
text.append(a)
</code></pre>
|
Draw a graph in R with header elaborate on two columns <p>I have a table with header expanded on two columns. How to draw a 3D graph on this table OR what would be a way to draw a graph on tables having elaborated headers. Kindly suggest me alternate ways to achieve this (if any)</p>
<p><strong>Crime Table</strong>: <... | <p>As I hate 3D plots for 3-way tables and I like ggplot2, I suggest this:</p>
<p>Gather your data into "long" format:</p>
<pre><code>library(tidyr)
st_long = gather(st, type, count, -c(year, what))
head(st_long, 3)
# year what type count
# 1 2014 Murder Reported 221
# 2 2014 Murder(Gain) Report... |
Any built-in serialazer JSONapi in Rails 5? <p>In Rails 4 we use active_model_serializers gem to make JSONapi. May be Rails 5 has own tools for serialization?</p>
| <p>So, I didn't find such built-in tool. Just two major gems: <code>active_model_serializers</code> and <code>jbuilder</code>. In <code>active_model_serializers</code> you should write ruby classes for serializers, so there isn't specific syntax. But in <code>jbuilder</code> you should use <code>*.json.jbuilder</code> ... |
Export Nested Gridview into Excel <p>I have the following UI design for a nested <code>GridView</code>. According to that I want a solution for exporting a nested <code>Gridview</code> into Excel.</p>
<p>Nested <code>GridView</code>
<a href="http://i.stack.imgur.com/3hClX.png" rel="nofollow"><img src="http://i.stack.i... | <p>You need to find the nested grid with <code>FindControl</code>:</p>
<pre><code> protected void Mastergrid_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "exportNestedGrid")
{
//convert the CommandArgument
int rowNumber = Convert.ToInt32(e.... |
How to Vlookup a filtered list <p>I am trying to figure out how to lookup information in a filtered table, returning only visible values.</p>
<p>For example, the data I want to use for the lookup is in cell A3, the lookup data is in another sheet in cells A2:E264. A normal lookup function would be =VLOOKUP(A3,'[IBD.xl... | <p><code>=INDEX([IBD.xlsx]IBD!$A:$E,AGGREGATE(15,6,ROW([IBD.xlsx]IBD!$A$2:$E$264)/(SUBTOTAL(3,OFFSET([IBD.xlsx]IBD!$A$2,ROW([IBD.xlsx]IBD!$A$2:$E$264)-MIN(ROW([IBD.xlsx]IBD!$A$2:$E$264)),))*([IBD.xlsx]IBD!$A$2:$E$264=A3)),1),2)</code></p>
<p>though such a construction will not work if the source workbook is closed.</p... |
How do I Load the file name into a new column through SSIS, using variables? <p>I have a set of files that are dynamically changing, I am using the foreach loop container to update them.</p>
<p>I am using two variables (1) for file path and (2) for source folder.</p>
<p>I need to insert the file names into a separate... | <p>So, try this:</p>
<pre><code>SELECT SUBSTRING(yourfield, 0, CHARINDEX('_', yourfield))
FROM yourtable
</code></pre>
|
jQuery Globalize parse negative number <p>I'm having problems parsing negative numbers with jQuery Globalize 1.1.1:</p>
<pre><code>Globalize.parseNumber('-1'); // = 1
Globalize.parseNumber('-100,00'); // = 100
</code></pre>
<p>So it seems Globalize is converting the negative number to a positive number. The following... | <p>Globalize (1.1.x) deduces the minus sign symbol from CLDR when parsing. In Swedish (sv), the minus sign is <code>â</code> (0x2212) not - (0x2D) as you have used in your example above. That's why it doesn't work for you. A quick test to assert parsing for negative numbers is:</p>
<pre><code>var sv = Globalize("sv"... |
How to upload images using codeigniter? <p>My controller function is </p>
<pre><code> <?php
class Image extends CI_Controller
{
public function index()
{
$this->load->view('image');
}
public function upload()
{
$config['upload_path'] = './images/';
$config['allowed... | <p>This is wrong. </p>
<pre><code>if (!$this->upload->do_upload())
</code></pre>
<p>Use as following. Use field name in <code>do_upload()</code> method</p>
<pre><code>if (!$this->upload->do_upload('myFile'))
</code></pre>
|
How to get element defined under MenuItem.Template from code behind? <p>I want to get the "textBoxLatitde" control in code behind.</p>
<pre><code><Image Name="icon">
<ContextMenu>
<MenuItem>
<MenuItem.Template>
<ControlTemplate>
<Grid>
... | <p>Try this: </p>
<pre><code>Grid grid = (icon.ContextMenu.Items[0] as MenuItem).Template.LoadContent() as Grid;
TextBox textBox = grid.Children[1] as TextBox;
</code></pre>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.