input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Selenium Webdriver - driver.get() not working correctly when inserting a variable inside <p><strong>This is solved. I had my baseURL wrong. And it was going to a different site, that redirected to the base url of the correct site. Thanks.</strong></p>
<p>I have a problem using driver.get() with a variable inside. For ... | <p>Try to be sure of URLs syntaxe (especially \ and //)
For some website, incorrect URLs redirect to baseURL page.
If you're working on an AngularJS project, you may need some waits (try ngWebDriver)
Good luck !</p>
|
C# Add extended interface to list <p>I'm currently trying to add a collection of interfaces to another collection - the problem is, i only want the extended interface, and not the parent. </p>
<p>Let me elaborate:</p>
<pre><code>interface IScanner
{
void scan();
}
interface IPhotocopier : IScanner
{
void Co... | <p>You should use the <code>AddRange</code> method, since that can iterate over the <code>Photocopiers</code> list and add all those items to the <code>Scanners</code> list:</p>
<pre><code>scannerBusiness.Scanners.AddRange(printerBusiness.Photocopiers);
</code></pre>
<p>You won't need any conversion since the <code>I... |
Karaf 4.0.6 - custom branding <p>I have a problem with custom branding in Karaf 4.0.6.
I've put branding.properties file into $KARAF_HOME/etc directory but the welcome message and prompt are still default.</p>
<p>Should I set up something more?</p>
| <p>Finally I found the solution. In my case I run karaf as server and then connect via ssh. Since karaf 4.0.6 you have to use file branding-ssh.properties for clients.</p>
<p><a href="http://karaf.922171.n3.nabble.com/Branding-properties-file-not-picked-up-by-Karaf-client-td4048143.html" rel="nofollow">Here I found th... |
Javascript: SHA512 value convert to JSON object <p>I already crypt the variable '<code>getShaValue</code>' to sha512. Then combine it with many variable like 'name','ic' using <code>JSON.stringify</code>. But when I debug my JSON object, the value of SHA512 didn't show the right value. If I only debug the value before ... | <p>You included the binary digest in the json. Try converting it to hex first:</p>
<pre><code>self.sha512 = function () {
var value = self.generateSHAvalue();
var shaHex = CryptoJS.SHA512(value).toString(CryptoJS.enc.Hex);
return shaHex ;
};
</code></pre>
|
Swift project migration from v1.3 to 3.0 <p>I have a requirement to do the swift migration from v1.3 to v3.0. This project also includes few dependencies managed via cocoa pods. I tried to update all the dependencies via pod update and started on migration with the migration tool provided by Xcode 8. </p>
<p>Is that t... | <ol>
<li>First of all make sure all the dependencies used in project are
migrated to swift 3.0</li>
<li>Then you can use the Xcode suggestion for the migration of your project to swift 3.0.</li>
</ol>
<p>There will be many errors which Xcode will not fix so you can build the project and fix the new issues which come... |
hibernate - select/load only field <p>I want to add a field in a Hibernate table-mapped/entity class. </p>
<p>I want this field to not be mapped to an actual table column, and I want Hibernate not to try to insert/update it to the DB. </p>
<p>But I want to be able to load this field via a custom select in the DAO... | <p>Well if i understand what you are trying to do well then i think the solution like this</p>
<p>@Column(name = "{name of column}", updatable = false)</p>
<p>In this way the hibernate will not try to update this column once the object created</p>
|
Why Select SQL queries on tables with blobs are slow, even when the blob is not selected? <p>SELECT queries on tables with BLOBs are slow, even if I don't include the BLOB column. Can someone explain why, and maybe how to circumvent it? I am using SQL Server 2012 R2, but maybe this is more of a conceptual problem that ... | <p>I got a suggestion then, have all the blobs in a separate table with an identity ID, then only save the identity ID in your main table</p>
<p>it could be because - maybe SQL cannot cache the table pages as easily, and you have to go to the disk more often. I'm no expert as to why though.</p>
<p>A lot of people fro... |
Highcharts: Tooltip delay before display <p>On my highchart i need a delay before the series tooltip is displayed.</p>
<p>I defined a new refresh function with a timer to realize it. If the timer is ready i check if the mouse position. If it moved not that much the tooltip should appear.</p>
<pre><code>function (H) {... | <p>You can make new tooltip basing on your standard Highcharts tooltip and show it on your mouseover with some timeout: </p>
<pre><code>load: function() {
chart = this;
this.myTooltip = new Highcharts.Tooltip(this, this.options.tooltip);
this.tooltip.label.element.remove();
}
point: {
events: {
... |
How can I have a Generic method here? <p>I have these methods, and you may think I may have it for the other number types too. Is there any way that I may merge these methods into one generic method?</p>
<pre><code>public long GetActiveDepartmentsQuotaOf ( Func<Department, long> exp )
{
return Departments ==... | <p>This will not work, because the <code>Enumerable.Sum</code> method only works on IEnumerables of certain types which can be summed up (e.g. <code>int</code>, <code>double</code>, <code>float</code>).</p>
<p>Here's the full overload list: <a href="https://msdn.microsoft.com/en-us/library/system.linq.enumerable.sum(v... |
How to correctly override and enhance property <p>Code tells more than words, so look at this:</p>
<pre><code>public abstract class ViewObject: INotifyPropertyChanged {
public virtual string Id {
get {
return this.GetType().Name;
}
}
}
public class Object : ViewObject {
private string id = string.... | <p>you are already using inheritance. Override method is useful when method name and parameter is same.
here you can use method overloading.
for method overload name is same but parameter is different. you can use in inheritance also.
i hope this is useful</p>
|
Ajax function replace messages <p>I want to replace the default window for messages in ajax with a div, for example I want to replace this code: <code>alert(data.status + ": " + data.message);</code> with a div.</p>
<p>This is my ajax code:</p>
<pre><code>//Start ajax code
if(!url){
... | <p>to set text/html to an element you can use like this...</p>
<pre><code>var html = '<div id="messages_product_view"><ul class="messages"><ul class="messages"><li class="'+type+'-msg"><ul><li>' + txt + '</li></ul></li></ul></div>';
jQuery('.messages').... |
Number of columns for result set error in SQL database for Java app <p>I'm having an issue with adding data to a sql database through Java on Netbeans. </p>
<pre><code>String bladeSerial;
String bladeType;
LocalTime startTime1;
private void startButton2ActionPerformed(java.awt.event.ActionEvent evt) { ... | <p>You need to give placeholder in your query. Change your code as given here... </p>
<pre><code>String query = "insert into TB01(SERIAL,BLADETYPE,STARTT1) values (?, ?, ?)";
PreparedStatement pstmt = conn.prepareStatement(query);
pstmt.setString(1, bladeSerial);
pstmt.setString(2, bladeType);
pstmt.setString(3, Strin... |
Redis in Vagrant(Ubuntu): how to forward redis port? <p>I tried to run redis in Vagrantbox(with Ubuntu image) an forward port 6379 to the port 16379 of the host machine, but for reasons I can't do this. So, I use Vagrantfile like this:</p>
<pre><code>VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VER... | <p>the problem was in the line:
appendfilename "/var/appendonly.aof"</p>
<p>If I run <code>redis-server redis.conf</code> manually, I'll see an error:</p>
<blockquote>
<blockquote>
<blockquote>
<p>'appendfilename "/var/appendonly.aof"'
appendfilename can't be a path, just a filename</p>
</blockq... |
Load Url image from Plist in Swift <p>I have a plist running in my project which contains number of image urls.I am trying to pass the url image to my imageView which is in the same viewController.I found similar questions from github like <a href="http://stackoverflow.com/questions/24231680/loading-downloading-image-f... | <p><code>path</code> is the path to your plist, not to your image URL.</p>
<p>The image URL is in the key "icon" in the "root" array.</p>
<p>Get the first item of the array and subscript with the key, you should get your image URL:</p>
<pre><code>if let item = root[0] as? [String:Any] {
if let result = item["ico... |
C3 - line chart. No lines shown <p>I'm trying to get the C3 line chart to be drown using a JSON input. But for some reason it is not showing the lines but only showing the points.</p>
<pre><code> chart = c3.generate({
data: {
x: 'x',
json: [
{"period":"2016-09-18","mp-demo-1":30},
{"period":"201... | <p>Maybe try moving both values to the same object in json:</p>
<pre><code>{"period":"2016-09-18","mp-demo-1":30, "MP7":20},
</code></pre>
<p><a href="http://jsfiddle.net/14gsxv0w/" rel="nofollow">http://jsfiddle.net/14gsxv0w/</a></p>
|
Gmail cannot receive wordpress email <p>I trying to send email to my <code>gmail</code>, but I cannot see the email in my <code>gmail</code>. I also tried to send the email to my <code>hotmail</code>, it is working when send to <code>hotmail</code>. </p>
<p>How do I fix this problem?</p>
<p>Thanks</p>
| <p>Today, email service providers are very string with spam. I think your mail that you sended with <a href="/questions/tagged/wordpress" class="post-tag" title="show questions tagged 'wordpress'" rel="tag">wordpress</a> is in your Gmail <code>spam</code> folder. You're maybe sending it from <code>localhost</co... |
Pasting Values in Excel not Formulas from a Macro <p>I currently have a macro that copies data from one sheet and archives it in another sheet. The issue that I have is that it is copying and pasting the formulas and it need to copy and paste values only. </p>
<pre><code>Sub Archive_Execution()
Dim mainworkbook As Wo... | <p>As mentioned in comments use <code>Range().PasteSpecial xlPasteValues</code> if you want to copy only values.</p>
<p>I also recommend using the <code>Intersect</code> method and <code>Worksheets("").UsedRange</code> to trim down your ranges.</p>
<pre><code>Sub Archive_Execution()
Dim strDataRange As Range
... |
Rails 5.0.0.1: Why does match controller in my routes file not work <pre><code>Rails.application.routes.draw do
#get 'welcome/index'
#get 'welcome/sample'
match ':controller(/:action(/:id))', : via => :get
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing... | <p>Your code works for me but <code>: via</code> should be <code>:via</code>.<br>
Also I would recommend you to use <code>get</code> instead of <code>match</code>. See <a href="https://github.com/rails/rails/blob/bdd518343e3dfaae1dad123db2a55d25773fc278/guides/source/routing.md#http-verb-constraints" rel="nofollow">rai... |
ES6 isomorphic-fetch does not send headers <p>I'm developing my first front-end app based on React. The aim of this app is to connect to a RESTful API in order to get and post data. The problem is I can't send the token header to pass the security check so the request fails. </p>
<p>I get different errors depend on th... | <p>I am going to response my own answer. Thanks to @cema-sp for the key to find what was happening.</p>
<p>The problem here was related to the CORS configuration in my Spring project. This Spring project exposes a REST API based on token security. It had two problems:</p>
<p>1-The OPTIONS request was blocked by the s... |
Zend Framework losing sessions at random moments? <p>Since a few days, I have a strange problem with Zend sessions. It seems that <code>Zend_Auth::getInstance()</code> seems to be empty at random moments, which causes users to be logged out. Sometimes this happens after a few seconds, sometimes a few minutes and someti... | <p>I found the problem. There was an image loaded on the login page, which didn't exist. For some reason this image kept loading until the maximum execution time of 30 seconds was exceeded. The error resulted in the session being cleared, even though the user had logged in meanwhile. You can't make this stuff up!</p>
|
Pattern matching maps as function arguments <p>I'm having trouble writing function clauses where I need to pattern-match against the map and also retain it for use in the function. I'm not able to understand what the syntax will be. Basically I want something like this:</p>
<pre><code>def check_data (arg1, %{"action" ... | <p>To match some keys of a map and also store the whole map in a variable, you can use <code>= variable</code> with the pattern:</p>
<pre><code>def check_data(arg1, %{"action" => "action1"} = map, arg2) do
end
</code></pre>
<p>This function will match any map containing the <code>"action1"</code> in the key <code>... |
Hibernate : unable to map mapping document as they are already available in <p><strong>configuration.cfg.xml</strong></p>
<pre><code><!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-co... | <p>The name attribute in Employee.hbm.xml is already specified(used twice/duplicate), please use the below update code in Employee.hbm.xml:</p>
<pre><code> <property name="firstName" column="firstName"/>
<property name="salary" column="firstName" />
</code></pre>
<p>The file name should be <code>Em... |
Close bootstrap model popup from another controller <p>Hi i have a controllerA which generate a form based on some URL parameters and after submitting that form some some action will be performed. Now i have created another controllerB and in that i have created a button. upon clicking on that button one model popup w... | <p>What's the relationship between controllerA and controllerB?<br>
if controllerB is the parent controller,you can use <code>$scope.$emit('event:close')</code> in controllerA and receive this event in controllerB with <br></p>
<pre><code>$scope.$on('event:close',function(evt) {
$scope.showpopup.close();
})
</code>... |
How can I do that circular countdown go with the clockwise? <p>I have a circular progressbar that is a countdown. The countdown starts at the top of the circular progressbar that's is fine, but go to the left doing the countdown. That I want is the rotation of the countdown go to the right, like the clockwise.</p>
<p>... | <p>Try this way to to set your rotation</p>
<p>circle_progress_foreground.xml</p>
<pre><code> <?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="270"
android:toDegrees="270">
<shape
android:innerRadiusRatio=... |
Updating session variables without page refresh <p>I'm using modal to display form. I want to validate form and show possible errors after clicking submit button. I don't want to close my modal after validation so I decided to use Ajax. Here is my code:</p>
<p>Modal:</p>
<pre><code><div class="modal fade" id="form... | <p>return the value of the session to your ajax and using jquery append the error to the page:</p>
<p>Add the following to your success function</p>
<pre><code>success : function(data){
$('label[for="name-input"]').html('</br>'+data.message)
}
</code></pre>
<p>in your php</p>
<pre><code>&l... |
How to add a shadow effect for UINavigation bar? <p>Do you have to add it programmatically? Or there is an option from the main.storyboard interface builder?and if there is a way from storyboard , How do you add it ? </p>
<p>Something like this :
<a href="http://i.stack.imgur.com/z05ha.jpg" rel="nofollow"><img src="h... | <p>You would have to add it programatically.</p>
<p>Do this in your UINavigationController Class</p>
<pre><code>self.navigationBar.shadowColor = UIColor.blackColor().CGColor
self.navigationBar.shadowOffset = CGSizeMake(5, 5)
self.navigationBar.shadowRadius = 5
</code></pre>
|
Animation lagging after sometime - Easeljs caching <p>The animation works alright on load but after sometime it's lagging. I was creating new <code>drops</code> variables inside the for loop at first. Making it global didn't help. <code>fps</code> is 40 with 5 <code>particles</code>. Any help?</p>
<pre><code>function ... | <p>Check the answer over here: <a href="http://stackoverflow.com/questions/28215208/easeljs-with-200-vector-shapes-performance-and-aesthetics/28238446#28238446">EaselJS with 200+ vector shapes : performance and aesthetics</a></p>
<p>You shouldn't create a new <code>Shape</code> in every frame. Instead do it once and s... |
Quotation marks for queries <p>If I use this:</p>
<pre><code>web<-remDr$findElement(using = 'xpath', "//*/li[@class='ode acs er cart']")
</code></pre>
<p>it works perfect. If I try to use a variable which contains the sting:</p>
<pre><code>myvar <- "/'ode acs er cart/'"
web<-remDr$findElement(using = 'xpath... | <p><code>myvar</code> is a variable, not a string. Using it accordingly is better:</p>
<pre><code>myvar <- "/'ode acs er cart/'"
x <- paste0("//*/li[@class=", mylar, "]")
web<-remDr$findElement(using = 'xpath', x)
</code></pre>
<p>You may not use <code>x</code> as a variable:</p>
<pre><code>myvar <- "/'o... |
How to overwrite ORM method unlink from a custom module? <p>I want to overwrite the <code>unlink</code> method of <code>stock.move</code> model. The reason is that I want to remove an OSV exception which warns about a forbidden action, and replace it with other message and other condition.</p>
<p>This is the original ... | <p>Not using a <code>super()</code> call can have unexpected behaviour. You could call <code>models.Model.unlink()</code>, but that will skip all <code>unlink()</code> extensions for <code>stock.move</code> by other modules (even Odoo S.A. apps/modules). In your case it would be:</p>
<pre><code>class StockMove(models.... |
Display select Mysql query in python with output nice and readable <p>I need python script for display sql query with nice output and readable this not readable for heavy tables...</p>
<pre><code>cnx = mysql.connector.connect(user='root', password='*****',
host='127.0.0.1',
... | <pre><code>import pypyodbc
ID=2
ConnectionDtl='Driver={SQL Server};Server=WIN7-297;Database=AdventureWorks2014;trusted_connection=yes'
connection = pypyodbc.connect(ConnectionDtl)
print("Retrieve row based on [FirstName]='Mani'")
cursor = connection.cursor()
SQLCommand = ("SELECT [FirstName],[LastName] "
... |
How to show a div when a particular button is clicked, <p>This my js code:<br> </p>
<ul>
<li><p>i want to click first button to call a new class,it works but, every
button doing same work. when i click second button this also calling
a new class.please help me to solve this.</p>
<pre><code> <script>
$(doc... | <p>If you want to click first button to call a new class , you can do by many ways .Here is checking with clicked text to get first button click</p>
<pre><code><script>
$(document).ready(function(){
$("button").click(function(){ /*button click event*/
if ($(this).text() == "first" ) $(".new").t... |
connecting to sql database from ASP.NET master page using c# <p>i Have this piece of code connecting to the database</p>
<pre><code>SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["savingsConnectionString"].ConnectionString);
string c = "select VersionName ,updated fr... | <p>Place this in your Web.config, with the correct configuration you can use your database in all your Controller's and classes. It is a much cleaner way and edible after you upload your ASP.NET application to a web-server. You can edit the Web.config every time you want. You can't change your connection this easy when... |
Unable to add duplicate entry through informatica <p>I am using Informatica to finally write in the oracle table after performing certain logical operations on the data.
The problem is that if a certain ID was already previously processed and is present in the target table then it is not inserted again.
Please suggest ... | <p><br>Hi,<br> This is because you might have same primary key in the source which is available in the target. Look into primary key columns and try loading them. <br></p>
<p>Altering your target table</p>
<pre><code>alter table target_table_name drop constraint constraint name;
</code></pre>
|
PHPMailer send() function crashes on live server but not XAMPP <p>I have been reading through SO trying to find an answer to my PHPMailer issue.</p>
<p>I am using the latest PHPMailer code and I have my code in a try and catch block. I am using the same SMTP credentials on both the XAMPP hosted site and the 1&1.co... | <p>Turns out after a phone call to 1and1.co.uk, that the only mail option they support is mail(). They told me that PHPMailer will not work on their servers. </p>
|
Badge on top of right navigation button <p>I have a requirement where I need to show the badge number on top of the right navigation button. Something like this: </p>
<p><a href="http://i.stack.imgur.com/5A2w6.png" rel="nofollow"><img src="http://i.stack.imgur.com/5A2w6.png" alt="enter image description here"></a></p>... | <p>I am working with this Framework here:</p>
<p><a href="https://github.com/enmiller/ENMBadgedBarButtonItem-Swift" rel="nofollow">https://github.com/enmiller/ENMBadgedBarButtonItem-Swift</a></p>
<p>Otherwise you could create your own View with a Badge. Just make an Custom UINavigationItem.</p>
<p>For example:</p>
... |
Typo3 - dd_googlesitemap multiple sitemap <p>I am using following two extension:</p>
<p>dd_googlesitemap and dd_googlesitemap_dmf</p>
<p>I have two Sitemaps:</p>
<p>Default pages:</p>
<pre><code>index.php?Eid=dd_googlesitemap
</code></pre>
<p>My extension:</p>
<pre><code>index.php?Eid=dd_googlesitemap&Sitemap... | <p>Look at line 9, character 55 and you'll probably end up near the '&' in the URL. In XML an ampersand is used to start an entity (and a semicolon ends it). In this case the characters following the '&' should be a valid entity name. This is of course not the case here, so you must encode the ampersand.</p>
<... |
OrderBy list LINQ Query <p>My Model contains List of <code>Offers</code>. offers having <code>SpecialOffers</code> value <code>true</code> should be orderd by <code>RGU</code> and <code>OfferPriority</code>. The offers having <code>SpecialOffers</code> value <code>false</code> should be ordered by <code>InitialPrice</c... | <p>You should first group by this property to get two groups which you can order separately:</p>
<pre><code>var offers = Model.Offers.Where(o => o.Provider.ProviderCode.Equals(provider));
var offerGroups = offers.GroupBy(o => o.SpecialOffer);
var specialGroup = offerGroups.Where(g => g.Key == true)
.Selec... |
Wordpress: How to create a custom search form only to a specific page <p>How do you create a custom search form that should appear only on a particular page?</p>
<ol>
<li><p>Using this <code><?php get_search_form(); ?></code> inserts wordpress's default search form to the page.</p></li>
<li><p>Adding this </p></... | <p>Do not modify searchform.php, as you want to use the default search for other pages. The below html code will create a custom form for you. Just paste the code in the template and you got your custom search form. </p>
<pre><code> <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">... |
XML To CSV Conversion Java <p>I was working on converting XML to CSV data. By looking at various examples I was able to write the code for parsing the XML file and getting the CSV file. However, the code I have written returns the CSV file which doesn't show all the tags present in the XML file. </p>
<p>I have XSLT fo... | <p>I suggest you use this as your starting point:</p>
<p><strong>XSLT 1.0</strong></p>
<pre><code><xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="UTF-8"/>
<xsl:template match="/school">
<!-- header -->
<xsl:text&g... |
__LINE__ macro not working when define printf's macro <p>The <strong>LINE</strong> macro gives random number and <strong>FILE</strong> macro gives a null when, the "printf" is defined with another macro. In the following code, I have shown the macro used for "printf" and the function (which is a method of a class), whe... | <pre><code>#define OTConsolePrint(x, y, z) printf(x, y, z)
</code></pre>
<p>When you call the macro in the function you pass three elements.</p>
|
Anemone - NoMethodError: undefined method `xpath' for nil:NilClass <p>I'm just starting to learn more about writing a web crawler in Ruby which is designed to crawl my blog and find broken external links using the Anemone gem and the rake task below...</p>
<pre><code>task :testing_this => :environment do
requir... | <p>It seems the error comes from <code>page.doc.xpath</code> : <code>page.doc</code> is nil.</p>
<p>Try to <code>inspect</code> your <code>page</code> in the <code>on_every_page</code> method.</p>
<p>You also can add a <code>if</code> before <code>.xpath</code> to avoid error: </p>
<pre><code>anemone.on_every_page d... |
Ruby on Rails 4 - config.consider_all_requests_local = true in production <p>In <code>config/environments/production.rb</code> I can set <code>config.consider_all_requests_local = true</code> to be able to see the errors with good info for debugging, but this will also show the error to users. </p>
<p>In <code>p... | <p>I'm not sure it's the best way to go to solve your errors.</p>
<p>You should <strong>temporary</strong> lower your <code>config.log_level</code> to <code>:debug</code> to see all details about your errors, solve it, then set it back to <code>:info</code>.</p>
<p>You can also use any tracking tool of your applicati... |
Joining Tables in Kibana <p>Suppose I have a huge database (table a) about employees in a certain department which includes the employee name in addition to many other fields. Now in a different databse (or a different table, say table b) I have only two entries; the employee name and his ID. But this table (b) contain... | <p><a href="http://stackoverflow.com/questions/22611049/join-query-in-elasticsearch">Similar questions</a> have been <a href="http://stackoverflow.com/questions/35272459/kibana-joining-two-documents-in-table-visualization">asked</a> and <a href="http://stackoverflow.com/questions/39150106/denormalizing-data-from-kibana... |
Convert Pandas dataframe to Dask dataframe <p>Suppose I have pandas dataframe as:</p>
<pre><code>df=pd.DataFrame({'a':[1,2,3],'b':[4,5,6]})
</code></pre>
<p>When I convert it into dask dataframe what should <code>name</code> and <code>divisions</code> parameter consist of:</p>
<pre><code>from dask import dataframe a... | <p>I think you can use <a href="http://dask.pydata.org/en/latest/dataframe-api.html#dask.dataframe.from_pandas" rel="nofollow"><code>dask.dataframe.from_pandas</code></a>:</p>
<pre><code>from dask import dataframe as dd
sd = dd.from_pandas(df, npartitions=3)
print (sd)
dd.DataFrame<from_pa..., npartitions=2, divis... |
Giving php-fpm user 'www-data' permission to write to directories owned by Docker root in container <p>Using php-fpm in a Docker container causes problems when writing files. The php-fpm runs as user 'www-data' and all the directories/files which are volume mounted in by Docker are owned by user root.</p>
<p>How can I... | <p><strong>Option 1:</strong></p>
<p>If you insist using sed, you can use it like:</p>
<p><code>sed -i 's/root/www-data/g' Dockerfile</code></p>
<p>Keep in mind that this will overwrite the file replacing all occurrences of <code>root</code> with <code>www-data</code>, so you might need to make a copy first to check... |
List of days for all weeks of a year <p>I want a method that gives me the list of days for all weeks of a year.</p>
<p>I found this interesting code form this link : <a href="http://stackoverflow.com/questions/33526602/getting-the-list-of-days-of-the-current-week-from-datetime-now">Getting the list of days of the curr... | <pre><code> public static List<DateTime> GetWeekDaysOfWeekFrom(int weekNumber)
{
DateTime firstDayOfWeek = FirstDateOfWeekISO8601(DateTime.Today.Year, weekNumber);
int currentDayOfWeek = (int)firstDayOfWeek.DayOfWeek;
DateTime sunday = firstDayOfWeek.AddDays(-currentDay... |
How do I get TextField like this <p>I've checked properties of <code>UITextField</code> and tried out to get a design for it like below. But I didn't succeed. </p>
<p><a href="http://i.stack.imgur.com/TuPdb.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/TuPdb.jpg" alt="enter image description here"></a></p>
... | <p><strong>Interface Builder:</strong></p>
<p><strong>Step 01 - adding the container views</strong>: add two views (and setup the suitable constraints) and connect them to the ViewController -as IBOutlets-:
<a href="http://i.stack.imgur.com/jFm1h.png" rel="nofollow"><img src="http://i.stack.imgur.com/jFm1h.png" alt="e... |
Table update and Primefaces ScheduleEvent <p>Hello i would like to ask your help to solve a difficult i meet in my project.
I am using primefaces Schedule to do a task and for that i store all events in a MySQL table named agenda.
My difficult concerns the table update. When i update for the first time all things perf... | <p>Try to use</p>
<pre><code>public void onDateSelect(SelectEvent selectEvent) {
agenda=new Agenda();
event = (ScheduleEvent) new DefaultScheduleEvent("", (Date) selectEvent.getObject(), (Date) selectEvent.getObject(),agenda);
}
</code></pre>
|
R Shiny clusterOptions not displayed on a tabPanel - conflict with rCharts? <p>I am sort of struggling to display clusters of positions on a tabPanel map, when on another tabPanel, a heatmap is active. </p>
<p>The weird thing is that when I remove the second tabPanel (heatmap) in the ui.R, then the clusters are shown ... | <p>Well, I finally came across the answer, thanks to a few posts and replies from Ramnath to other people issues in the website.</p>
<p>In the ui.r, for the second tabPanel, the trick was just to replace</p>
<pre><code>showOutput("baseMap", "Leaflet")
</code></pre>
<p>by :</p>
<pre><code>htmlOutput("baseMap")
</cod... |
UICollectionView indexPath.row strange behaviour <p>I'm having strange issue while scrolling one of my collectionViews. When I'm printing <code>indexPath.row</code> is goes ok from 0..6 but then last <code>indexPath.row</code> is 3, and then if I scroll back it either crashes with excbadadress or prints 1, 2, 4 in rand... | <p>Ok, the problem was that I've tried to apply gradient to a <code>UIView</code>, which had elements (<code>UILables</code>). What I had to do is add a subview to the <code>UIView</code> and apply gradient to it. </p>
|
C# - How to assign a new data table in a datagridview datasource when it already contains an initial data table <p>My code works like this:</p>
<pre><code>MyDataGridView.Datasource = initialdt
</code></pre>
<p>then I want to assign a new data table to it:</p>
<pre><code>MyDataGridView.Datasource = newdt
</code></pre... | <p>You need to call <code>Databind</code> to make changes </p>
<pre><code> MyDataGridView.Datasource=Null;
MyDataGridView.DataBind();
</code></pre>
|
Transparency - replace EVAL in matlab <p>I have the following code that does some sorting on matlab, but relies on eval. This is part of a much bigger set of code, and I have simplified it to be able to put it here. Basically, I am looking for an easy way of getting rid of the function eval, so that I can use a parfor ... | <p>Not in the opportunity to try it in detail, but here is the generic answer to your problem:</p>
<p>You currently put an <em>index</em> in the <strong>name</strong> of a struct (or field?). </p>
<p>Rather than doing that, simply keep the names fixed and add dimensions.</p>
<p>So rather than using variables like <c... |
I want to search and the specific Nodes or elements in xml and create new xml from the select nodes <p>I want to create new Xml file from the select nodes only i am using dom4j to parse and create new xml file. Example lets assume Nodes Customer name = Joseph is the child of root element TRX i want to show the whole ... | <p>You should select the nodes you need, then append them as children of another element and put this element as root of a new document. Note that first XPath expression seems incorrect (maybe it should be <em>//TRX[@type=16]</em>)</p>
<pre><code>private Document daMethod(Document document, String xpath) throws Except... |
Wordpress - Change home page on mobile device <p>I have been searching for some solution to make my home page on mobile devices different than on normal browsers. I need 100% reliable solution but i found only:</p>
<ul>
<li>Checking with $is_mobile (it doesn't work in all cases)</li>
<li>Using JS scripts to calculate ... | <p>I too spent a lot of time on this topic. I would simply say do not use <code>wp_is_mobile</code>. It can be used to load an entirely new page but it is not reliable. And since you are looking for a reliable solution I would say do not use it. It fails.</p>
<p>Rather use javascript to alter different elements of you... |
Django error while saving Foreign Key - Can not assign none , Doesn't allow null values <p>I have two models - Events and Tenants. </p>
<pre><code>class EventsModel(models.Model):
sys_id = models.AutoField(primary_key=True, null=False, blank=True)
tenant_sys_id = models.ForeignKey('tenant.TenantModel', on_dele... | <p>Your ForeignKey should be called <code>tenant_sys</code>, not <code>tenant_sys_id</code>. Django will automatically add the <code>_id</code> suffix to the underlying database field, but the value you have in Python is actually an instance of the target model, not an ID.</p>
<p>With the code you have, you are still ... |
ForkJoin 2 BehaviorSubjects <p>I have two behaviour subject streams what I'm trying to forkJoin with no luck.
As I imagined it gives back the two last values of it. Is this possible to implement it somehow?</p>
<p>It is not called after the subject.</p>
<pre><code>let stream1 = new BehaviorSubject(2);
let stream2 = n... | <p>Note what <a href="https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/forkjoin.md" rel="nofollow"><code>forkJoin()</code></a> actually does from its documentation:</p>
<blockquote>
<p>Runs all observable sequences in parallel and collect their last elements.</p>
</blockquote>
<p>This ... |
Synchronous exceptions in async functions <p>What happens if an <code>async</code> function throws an exception synchronously?</p>
<p>Example:</p>
<pre><code>async function whatHappen () {
throw new BombError()
// no "await" here
}
try {
whatHappen().catch(() => console.error('rejected'))
} catch (e) {
co... | <p><strong>Yes, an async function always returns a Promise.</strong></p>
<p>In the technical proposal that you linked to, there is a sentence in the beginning stating that:</p>
<blockquote>
<p>A similar proposal was made with Deferred Functions during ES6 discussions. The proposal here supports the same use cases, ... |
How to send a message from node.js function to angular controller <p>I have a variable called <code>message</code> in node.js function now I want to send it to angular controller. How to do this?</p>
<h2>api.js</h2>
<pre><code>router.post('/pages/auth/forgot-password', function(req,res,next){
var maillist = req.b... | <p>Try to do in your last callback</p>
<pre><code>transport.sendMail(mailOptions, function(error, response) {
if (!error) {
var message = {
message: 'An e-mail has been sent to ' + maillist + ' with further instructions.'
};
done(null, message);
}
trans... |
nest for elasticsearch version 2.0.0.0 partial update on nested objects <p>Say, I have some <code>POCO</code> like following. </p>
<pre><code>public class Graph
{
public string Id { get; set; } // Indexed by this
public List<Node> NodeList { get; set; }
}
public class Node
{
public string Id { get; ... | <p>Because <code>NodeList</code> is a <code>List<Node></code>, a partial update is not possible as the provided value would replace the existing value.</p>
<p>You can however use <a href="https://www.elastic.co/guide/en/elasticsearch/guide/2.x/optimistic-concurrency-control.html" rel="nofollow">optimistic concur... |
What does the -> notation after the function parenthesis signify? <p>For example, in:</p>
<pre><code> virtual auto create_obj() -> std::unique_ptr<Base>
{
return std::unique_ptr<Base>{};
}
</code></pre>
<p>What does -> signify ?
Since the return type is specified as auto, why is it necessary ?... | <p>It is referred to as <em>trailing return type</em>, it is simply another way to specify the return type of a function.</p>
<p>One situation where it is useful is returning a function pointer from a function. Here is the "standard" syntax:</p>
<pre><code>void yoyo(){
std::cout << "yoyo!\n";
}
void(*my_fn... |
PHP - check if file is archived without using handle resource <p>Is there a way to check if content received from remote server is a .zip archive? I found many solutions here, but all of them are for local files; therefore, these solutions use file handle resources like fopen, fgets, etc.</p>
<p>Put simply, curl is us... | <p>After some more research, I found out zip archives should start with "PK", so I wrote such a code (in case someone has a similar problem in future):</p>
<pre><code>if (substr($content, 0, 2) == 'PK' && strlen($content)>100000) {echo "this is zip";}
</code></pre>
<p>This code is not the greatest choice (... |
How to let googlemail send an automatic mail -from- a secondary mail adress? <p>I'd like to send a mail with GoogleScript - not from my main-Gmailaccount, but from a secondary mail account, which is setup correctly in the main Gmail account.
I can send emails from the secondary mail account manually in Gmail, so that w... | <p>If your secondary email is setup as an alias of your email account it is possible. The specification mention:</p>
<blockquote>
<p>from: the address that the email should be sent from, which must be
one of the values returned by getAliases()</p>
</blockquote>
<p>When you execute getAliases(), do you see your al... |
Django & wsgi - setting on debian 8 <p>I'm new to Django and I want to configure my app with apache2. I just follow the guide and the other question, but I can't figure out!
My simple configuration file sites-available/000-default.conf:</p>
<pre><code><VirtualHost *:80>
WSGIScriptAlias / /var/www/html/mysite... | <p>Some things to check: Do you load the wsgi module?</p>
<pre><code>LoadModule wsgi_module modules/mod_wsgi.so
</code></pre>
<p>Also look for this answer and a potential gotcha in the Apache2 configuration: <a href="http://stackoverflow.com/questions/17766595/403-forbidden-error-with-django-and-mod-wsgi/28394998#283... |
Error Msgs After Package Updates for My Dashboard Outputs <p>I just installed a bunch of new package updates this morning (including plotly, dygraphs, rCharts, shiny and shinydashboard), and suddenly almost all outputs on my dashboard that I worked months on are broken, while they worked yesterday without a problem! Fo... | <p>I think that the new packages you install have objects of the same name of your old packages, thereby "overwriting" your old objects. You could try accessing your masked objects by using graphics::layout() instead of layout().</p>
<p>Edit: Look <a href="http://www.ats.ucla.edu/stat/r/faq/referencing_objects.htm" re... |
How to convert jpg or png to svg in IOS? <p>I like to convert an .jpg or .png file to an .svg format that can be displayed in UIImageView. Is there a way to do this in Objective-C?</p>
| <p>You <a href="https://developer.apple.com/reference/uikit/uiimage" rel="nofollow">shouldn't</a> use SVG images in Xcode:</p>
<blockquote>
<p>it is recommended that you use PNG or JPEG files for most images in your app. Image objects are optimized for reading and displaying both formats, and those formats offer bet... |
Why evaluate() in Protractor? <p>When I run the below snippet, I got the following output. But I'm still unclear why and when evaluate() has to used ....</p>
<pre><code> browser.get('https://weather.com/en-IN');
$$("input[data-ng-change='goSearch()']").evaluate('placeholderText').then(function(value) {
... | <p><a href="http://www.protractortest.org/#/api?view=ElementArrayFinder.prototype.evaluate" rel="nofollow"><code>evaluate()</code></a> is rarely used, but has a unique purpose - it gives you an <strong>access to the scope</strong> of the current element you are working with. This is usually needed when a value you are ... |
Android studio path to external sdcard <p>I need to change the file path to work with my web application from which I upload files to my android device to an external sd card...</p>
<p>This code was working on android 2.2 tablet long time ago, now I have to make a change to work on tablet with Android 4.4.2, but I don... | <p>Starting in <a href="https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#KITKAT" rel="nofollow">Kitkat</a> , you need permission for read/write opperations on the external storage :</p>
<p>Make sure to add the permissions in your <code>AndroidManifest</code>.xml like this :</p>
<pre><code>&... |
How to get input value from ng-repeat in Angular <p>I am trying to do a simple shopping cart in angular. Basically I have list of items and would like user to enter Quantity and then get the list of items that have Qty more than 0. </p>
<p>If the Qty is greater than 0 then I will add them into an array otherwise remov... | <p>Maybe something, like this?</p>
<pre><code><input type="number" ng-model="extra.Qty" ng-change="extraSelected()">
$scope.extraSelected = function () {
$scope.selectedExtra = [];
angular.forEach($scope.extras, function(extra) {
if(extra.Qty > 0) {
console.log('Extr... |
Does IBM DB2 support character length semantics? <p>Does IBM DB2 support character length semantics? If yes, then please tell me how to enable it.
Thanks</p>
| <p>Look at the documentation [for whatever variant\platform and version] of DB2 that is an available option [i.e. existing and\or installed, or can be obtained], for availability of the scalar function:</p>
<blockquote>
<p>CHARACTER_LENGTH</p>
<p>The CHARACTER_LENGTH or CHAR_LENGTH function returns the length o... |
Junior in VR. Google map, google streetview and RTSP <p>I'm new comer to VR and I ask you for tips and link for quick start.</p>
<p>My goal is Application for Oculus Gear VR
Inside of App I need:
Show to user Google map (and markers on the map) - with option zoom in/out
On the click on button (or something else ) - Go... | <p>I don't understand well what you are asking for.</p>
<blockquote>
<p>Is VR app differ from simple game app in Unity (Like Android or Iphone
game)?</p>
</blockquote>
<p>It is in fact a simple game app in Unity using special plugind which manages the cameras and the input. But in fact a game made in Unity is por... |
Error while opening Jmeter Plugin Manager <p>I just added the plugin manager jar(jmeter-plugins-manager-0.10) in lib/ext folder of Jmeter(3.0). I keep getting this error when I try to open Plugin Manager through the Options. Can someone please help.</p>
<p>I tried to run the jmeter through command prompt using Jmeter.... | <p>Try pinging from the machine where you run jmeter the site:</p>
<blockquote>
<p>ping jmeter-plugins.org</p>
</blockquote>
<p>Your error here is that the DNS does not even know this website</p>
|
Symfony3 Doctrine working with timezones <p>I just migrated a Symfony2.4 project to Symfony3.0 and I am facing a wierd situation.</p>
<p>The project's default timezone is UTC, everything is stored as UTC timestamps in the MYSQL database.</p>
<p>I retrieve an entry with a datetime field named 'checkOut', pass it to th... | <p>That's because you are changing the default timezone of your server rather than changing the timezone of the DateTime instance in question. One of my pet hates! </p>
<p>I am not familiar with twig, but doing something like this would give you the expected result:-</p>
<pre><code><p>{{ dump(entity.checkOut) }... |
Rails 4: Get Controller class from Model class <p>Is there any easy way to get Controller class name from Model class?.
Example:</p>
<pre><code>Invoice => InvoicesController
</code></pre>
<p>Tried <a href="http://api.rubyonrails.org/classes/String.html#method-i-tableize" rel="nofollow">tabalize</a> but it returns ... | <pre><code>s = Invoice
s.name.pluralize + 'Controller'
=> "InvoicesController"
</code></pre>
<p>To get the controller class itself...</p>
<pre><code>"InvoicesController".constantize
=> InvoicesController
</code></pre>
|
DAX sub-total wrong when filtered by other filter <p>I have searched a lot and not found an answer. Please help.
I have a power pivot summarising sales data on various levels of hierarchy. </p>
<p>I HAVE ADDED a picture showing data structure and expanded examples to be more illustrative.</p>
<p>The data has products... | <p>Answering my own question as it seems everyone gave up on me :(
I spent a weekend trying different combinations of various functions, and it appears, I needed to do is use either</p>
<pre><code>NEW CAT TOTAL:= SUMX(VALUES(TBL[Market], [Category Totals])
</code></pre>
<p>where </p>
<pre><code>Category Totals... |
Cordova fingerprint authentication on server <p>I am trying to create a authentication mechanism in my (cordova) app for android that will allow my users to sign in using a password and username, or allow them to scan their finger in order to sign in. </p>
<p>How can one verify a fingerprint registered on a client, se... | <p>You can't authenticate fingerprint on the server, fingerprints are stored or authenticated using <code>Live Scan/Biometric template</code>. Authentication is done by comparing the current scan template with previously stored templates </p>
<p>First of all you don't have access to these stored templates(Not provide... |
Permissions dialogue not showing on fragment in api 23 <p>I am amateur in android,I am trying to upload files to server from app,I need to request permission from user but the dialogue doesn't pop up in fragment.
I have a <em>FilePath</em> class which helps get path,The verify permissions method is also in this class w... | <p>Permission dialog is not shown if user denies a permission. In the second launch, user will get a "Never ask again" option to prevent application from asking this permission in the future.</p>
<p>However it is quite bad in term of UX if user does something but there is nothing to interact back. This case has to be ... |
Xaml- Escape '@' in binding path <p>My binding is like this:</p>
<pre><code><... SelectedItem={Binding ElementName=NAME, Path=MyProperty.@enum} />
</code></pre>
<p>The <em>@enum</em> is inner property and the @ is part of it's name.</p>
<p>The error I get is </p>
<blockquote>
<p>Unexpected token</p>
</block... | <p>The <code>@</code> character is used to escape an identifier name that would otherwise be recognized as C# keyword. Since <code>enum</code> is a keyword in C#, you'll have to escape it, but that applies only to C#. The property name is still <code>enum</code>.</p>
<p>So the corrent property path is also <code>MyPro... |
Adapting IE8 to IE11 <p>I have this code: </p>
<pre><code>container = document.getElementById("menuContainer");
</code></pre>
<p>and later on:</p>
<pre><code> container.document.open("text/html");
container.document.writeln(content);
container.document.close();
</code></pre>
<p>In IE8 works but in IE11 w... | <p>The recommended standard reference from the node to a document has been <code>node.ownerDocument</code> since <a href="https://www.w3.org/TR/DOM-Level-2-Core/core.html#node-ownerDoc" rel="nofollow">DOM Level 2</a>. According to <a href="https://msdn.microsoft.com/en-us/library/ms534315(v=vs.85).aspx" rel="nofollow">... |
Django Standalone Script <p>I am trying to access my Django (v1.10) app DB from another python script and having some trouble doing so.</p>
<p>This is my file and folder structure:</p>
<pre><code>store
store
__init.py__
settings.py
urls.py
wsgi.py
store_app
__init.py__
admin.py
apps.py
model... | <p>This sounds like a great use case for <a href="https://docs.djangoproject.com/en/1.10/howto/custom-management-commands/" rel="nofollow">Django Management commands.</a> which has the added bonus you can run it scheduled from cron, direct from the commandline, or call from inside django. This gives the script full ac... |
How to get aggregated logs of application submitted on yarn via web ui of Ambari log search service <p>I'm not able to find the logs of application I have submitted on the the yarn on ambari cluster via log search service.</p>
| <p>You can access logs from CLI using <code>yarn logs -applicationId <application ID></code></p>
|
Yii2 URL Management - issue in passing key-value pairs in URL <p>I am upgrading my website from Yii 1.1 to Yii2. In the older site using Yii 1.1, the url can be given as </p>
<p><code>http://example.com/index.php/controller_name/action_name/queryString/123</code></p>
<p>But in Yii2 I have to change this request to </... | <p>You need to enable pretty urls,and the add rules accordingly.</p>
|
What is the difference between height = 2px and height = 2 <p>What is the difference between height = 2px and height = 2? When we don't specify units like px or em what unit does it take?</p>
| <p>It should not work.</p>
<p>If you checked the dev-tools, you'll notice this message <code>height: 50;</code></p>
<blockquote>
<p>Invalid property value</p>
</blockquote>
<p>Because you have to add units, so that the browser know how to render your element.</p>
|
How to get all functions of es6 class instance <p>For example, I have some class with some methods:</p>
<pre><code>class SomeClass() {
someMethod1() {
}
someMethod2() {
}
}
</code></pre>
<p>Can I get all function names of this class instance?</p>
<pre><code>Object.keys(new SomeClass())
</code></pre>... | <p>You have to call <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames" rel="nofollow"><code>Object.getOwnPropertyNames()</code></a> on the <code>prototype</code> property of the class.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-c... |
Node.js print directory files <p>Currently working on a small project and having a few issues with getting files to print onto the page.
Currently, all files within my /views directory will print, however, I am wanting to expand this so it can print files within folders, for example, /views/test/prototype.html.</p>
<... | <p>You need to examine <code>files</code> array with <a href="https://nodejs.org/api/fs.html#fs_fs_fstat_fd_callback" rel="nofollow"><code>fs.stat</code></a> and recursively do <code>getFiles</code> on directories.</p>
<p><a href="http://stackoverflow.com/a/5827895/5341953">This answer</a> solves similar problem</p>
|
how to create a text file through python <p>Looking to create a program that needs to take the users sentence, list its positions, and also identify each individual positions of word and then save a list of the position numbers to a file, I've got as far as:</p>
<pre><code> text = input('Please type your sentence: '... | <p>Use the open function with the 'w' or 'a' access modifier.</p>
<p>e.g.</p>
<pre><code>fo = open("foo.txt", "w")
</code></pre>
|
Effective way to locally compile each commit <p>I often want to split my newly written code into multiple commits. I also want to verify that each commit compiles.</p>
<p>Is there any efficient way to locally ensure that each commit compiles without having to stash, compile and stash pop through each one?</p>
| <p>You can make a <strong>pre-commit</strong> Git Hook to make sure all of the code that you are trying to commit can actually compile.</p>
<p>There are some samples given in the <em>.git/hooks</em> folder of your repository.</p>
<p>More information about Git Hooks can be found <a href="https://git-scm.com/book/it/v2... |
Formula added to embedded chart in Powerpoint with VBA is referencing wrong cells <p>I'm updating charts in <code>Powerpoint 2007</code> from queries in <code>Access 2007</code>.<br>
The charts have been manually added and set up using <em>Insert ~ Object ~ Microsoft Office Excel Chart</em> and should look like this (I... | <p>I'm adding this as an answer, but not the accepted answer as it's a workaround.</p>
<p>My original code used a formula to calculate the value needed for the spacer series - this kept placing an incorrect formula:</p>
<pre><code> 'Add spacer rows to the raw data (equal to the maximum value in the row above p... |
BATCH> run .exe files which paths are contained in a text file <p>I'm working on a start script, and I have a text file <code>output.txt</code>, containing paths to programs, like:</p>
<blockquote>
<pre><code>C:/program1.exe
C:/abab/program2.exe
</code></pre>
</blockquote>
<p>How do I now run the programs contained i... | <pre><code>for /f "usebackq delims=" %A in ("C:\output.txt") Do Start "" "%A"
</code></pre>
<p><code>Start</code> starts programs without waiting for them to exit (so new window) and first set of quotes is the window title. <code>UseBackq</code> is needed to use quotes around output.txt. See <code>For /?</code> and my... |
Java TreeSet Not Working as Expected <p>I built my own class that implements comparable (maybe not relevant) and when I try using a HashSet to store the items, the HashSet sometimes claims that the item is in the HashSet even though it is not. I thought it had to do with reference checks, but I confirmed that is does n... | <p>With your <code>hashcode</code> calculation the points <code>(1,12)</code> and <code>(11,2)</code> will be treated as identical.</p>
<p>See <a href="http://stackoverflow.com/questions/113511/best-implementation-for-hashcode-method">best-implementation-for-hashcode-method</a> for advice on hash codes.</p>
|
Apache poi multiline bullet point is working but not multiple paragaraph? <p>Generate word document using apache poi library bullet point is working but i trying multiple paragraph not working,i have pasted below,</p>
<p>my java class code :</p>
<pre><code>package samplebuller;
import java.io.FileInputStream;
import... | <p>There mainly two issues with your code:</p>
<ol>
<li><p>Your <code>run</code>s are all in <code>para</code>, which is the first paragraph. I don't believe that this shall be so.</p></li>
<li><p>Your <code>addListStyle</code> creates abstract numberings each time it is called. So your <code>numbering.xml</code> gets... |
Magento admin showing blank page after upgrade <p>I have upgraded Magento from 1.7.x to 1.9.2.4 using Magento connect. </p>
<p>Now when I open admin panel it's showing blank page, but the frontend is working fine. </p>
<p>I have cleared cache and session but it's still showing blank page.</p>
| <p>You need to debug the system as:</p>
<ol>
<li><p>You can enable printing errors by renaming file <code>local.xml.sample to local.xml</code>. file location <code>magentoRootDirectory/errors/</code></p></li>
<li><p>set permissions 777 to <code>magentoRootDirectory/var</code> folder</p></li>
<li><p>In Index page chang... |
http client not reslove in the android studio <p><strong>Build Gradle</strong> </p>
<pre><code>apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.example.sushant.registrationdemo_tushar"
minS... | <p>Just add this dependency in your gradle...</p>
<pre><code>compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
</code></pre>
<p>hope it helps.</p>
|
React native modal with list view item click <p>I want to pop a view modally when a list item is clicked.and been using this code it works fine if i dont scroll the list view and doesn't work at all if i scroll.</p>
<pre><code>renderGymData(rowData){
return(
<View>
<Modal
animationType=... | <p>Use only a Modal, and render it bellow in <code>ListView</code>, not inside <code>renderRow</code>, and pass row data to Modal when list item is clicked.</p>
<pre><code>render() {
return (
<View>
<ListView
dataSource={this.state.dataSource}
renderRow={this.renderGymData.bind(thi... |
Bootstrap tiered radio buttons with jQuery <p>I'm fairly new to jQuery, and currently learning it, so please forgive me if what I'm asking is so ridiculous.</p>
<p>I'm creating a web-form in using Bootstrap which uses radio buttons and is tiered, so when you select "Yes" for the first option, it will display the next ... | <p>For selecting any input with particular name with jQuery we use </p>
<pre><code>[name="xyz"]
</code></pre>
<p>In your case is must be </p>
<pre><code>$("input[name='wireless_use1']")
</code></pre>
<p>If you want to trigger an event on change the it must be like </p>
<pre><code>$("input[name='wireless_use1']").c... |
post_type how to get 1 title <p>I have done some research on this and couldnt find anything about it.</p>
<p>I got 4 different post.</p>
<pre><code>$args = array(
'post_type'=> 'post',
'order' => 'ASC' );
$the_query = new WP_Query( $args );
if($the_query->have_posts() ) : while $the_quer... | <p><strong>EDIT :</strong> What to you get with this part only ? </p>
<pre><code> <?php
$args = array(
'post_type'=> 'post',
'order' => 'ASC'
);
$the_query = new WP_Query( $args );
... |
typescript re-export modules with SystemJS not work <p>I Try to re-export modules according to typescriptlang web site - modules I use SystemJS as module loader :</p>
<p><strong><em>app.ts</em></strong> </p>
<pre><code>import * as s from "./AllValidators";
// Some samples to try
let strings = ["Hello", "98052", "101... | <p>The code in Validation.ts is not properly detected by SystemJS as using es6 features, so it skips compilation and tries to load that file as it is, causing the error.</p>
<p>The workaround is to declare the format explicitly - you need to add <code>meta</code> to <code>src</code> package configuration:</p>
<pre><c... |
Ajax change php variable <p>I've got this variable <code>$type</code> and I want it to be <code>month</code> or <code>year</code>.
It should be changed by pressing a <code>div</code>.</p>
<p>I've tried creating an <code>onclick</code> event with an ajax call. </p>
<p>The <code>ajax</code> call and the <code>variable<... | <p>as you are sending request to the same page so as a result full page is return .You will have to send it to another page and from that page return the type variable</p>
<pre><code>if(empty($_POST['type'])){
$type = 'month';
} else {
$type = $_POST['type'];
echo $type;
</code></pre>
<p>keep this code in sep... |
making hyperlinks clickable in multiline fields <p>I have a requirement in SharePoint, in which I have a multi line field (with Plain text type) which stores description. In some of the list item the description contains urls. But in the page its showing as real text instead of links. I need to convert these url as cli... | <p>There is an way to achive this with the OOTB in SharePoint !<br>
You just need to change a settings of your Field (of type Multiple lines of text) you need to change the type of text to : <strong>Rich Text</strong></p>
|
How to store data in each ms in simulink to a vector variable <p>In my simulink model :
I am getting a variable acceleration data (0.2232, 0.221, 0.210, 0.225, 0.2231 and so on) which is a scalar for 500ms. My sample time is 1ms. So I need to store each of this data (which is always changing) in a vector (for 500ms). H... | <p>I used a data store write(as a buffer) and an index value and assignment block to generate an array.</p>
|
Gradle changing module from nexus snapshot repo not updated <p>I have a problem with a snapshot artifact not being uploaded. </p>
<p>I'm using snapshot version. Atrifact is marked explicitly as <code>changing: true</code> and <code>cacheChangingModulesFor</code> is set to 0 seconds. </p>
<p>When i run <code>--refresh... | <p>I think you maybe have the syntax for the changing dependency slightly wrong. </p>
<p>Can you try replacing:</p>
<pre><code>compile group: "pl.example", name: "name", version: "0.7.6.1-SNAPSHOT", changing: true
</code></pre>
<p>with:</p>
<pre><code>compile ("pl.example:name:0.7.6.1-SNAPSHOT"){ changing = true }... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.