Sunday, December 31, 2017

FAILURE: Build failed with an exception. on existing react native app

Leave a Comment
I am facing a issue with React Native existing app code during installation in my linux OS. Everything is setup (React Native and Android Studio ) I am facing when i am running a command here is the error message, :app:processDebugResources /home/akaruilabs/ReactNative/teletask/android/app/build/intermediates/res/merged/debug/values-v24/values-v24.xml:3: AAPT: Error retrieving parent for item: No resource found that matches the...
Read More

Python fbprophet - export values from plot_components() for yearly

Leave a Comment
Any ideas how to export the yearly seasonal trend using fbprophet? The plot_components() function plots the trend, yearly, and weekly. I want to obtain the values for yearly only. Much appreciated. 1 AnswersAnswers 1 Example data: import pandas as pd from fbprophet import Prophet import matplotlib.pyplot as plt df = pd.DataFrame.from_dict({'ds': ['1949-01', '1949-02', '1949-03', '1949-04', '1949-05', '1949-06', '1949-07',...
Read More

Does not login into account at first time in Codeigniter 3 framework

Leave a Comment
I have a website and login system. In localhost everything is perfect. However, in the server (HOSTGATOR), when people want to log in their account, they type login password and hit "Login" button, it refreshes the page but does not log in. They should enter 2-3 times and then systems logs in. Where can be the problem? public function __construct() { parent::__construct(); $this->load->helper(array('form','url', 'security')); $this->load->library(array('session', 'form_validation', 'email')); ...
Read More

How to trigger MouseDown via PhantomJS?

Leave a Comment
I tried: var clickEvent = document.createEvent('MouseEvents'); clickEvent.initEvent("mousedown", true, true); jQuery('.left-rail-facets .facet-list .facet.CS .suggestion[data-value="B"] a')[0].dispatchEvent(clickEvent); but it just fails to trigger the action on the site. no error returned. 2 AnswersAnswers 1 This is how you programmatically trigger a click on a DOM element with a "mousedown" event. To answer your question, you need to have two things in your source code: event listeners to detect the clicks...
Read More

Retrieve data from a table of aspx page using Excel VBA

Leave a Comment
I am trying to retrieve table data from aspx page using excel vba.I know how to get table data from a URL but below is the main problem. Problem There is an aspx page (say www.abc.aspx). I am currently on this page.Let this page be page1. Now I click a page2 link on the current page. What is worth noticing is that after clicking this link, the old URL (www.abc.aspx) doesn't change but the content changes.( Content is of page2 ) If you view page1 source code it has <form method="post" action="page1 url" id="Form1">...
Read More

HTML5 Video - Get final src URL destination

Leave a Comment
I'm displaying video content from a 3rd party service on my website: <video src="http://www.example.com/api/v1/media/video.mp4?status=true"></video> The service detects the user's geo-location and browser's language and returns video that fit those parameters. http://www.example.com/api/v1/media/video.mp4?status=true REDIRECT TO http://www.example.com/api/v1/media/US/EN/English_CAT.mp4 Other than the media URL, the service doesn't provide the actual file name that particular user received. How can I...
Read More

Saturday, December 30, 2017

Selenium hangs when using actionchain().move then actionchain.click or mouse_up

Leave a Comment
I'm using selenium2library for automation testing for drag drop action. I'm running on windows 8 64bit, selenium 2.48.0, ride.py. Browser used to test: firefox and chrome latest stable version what I did was to create a dummy html page with input text and a link, and try drag that link into the input text Here is the html: <div id="wrapper"> <input id="target" type="text" style="width:200px; height:50px" /> </div> <a id="source" href="http://google.com" >drag me </a> And here is my python...
Read More

React Native: Is it possible to create floating chat heads like facebook messenger?

Leave a Comment
Is it possible to create floating chat heads like facebook messenger by using react native? 1 AnswersAnswers 1 Without native coding, you can just make them show inside of your app, here is fine example, it basically extends react-native-interactible example. If you want them to stay when the app is closed, I am afraid that there is not some react native library at the moment (as far as I know) that can provide you that, just native code something like in this article. ...
Read More

Twitter Boostrap - Align label horizontally to dropdown

Leave a Comment
I would like to have the label for the dropdown next to the dropdown menus. Find below how my current example looks like: <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <ul class="nav nav-pills" role="tablist"> <li role="presentation">Order: </li> <li role="presentation" class="dropdown"> <a href="#" class="dropdown-toggle"...
Read More

How to read nested properties from configuration file in java

Leave a Comment
I want to read Name property from configuration file config.properties Person{ Name= ABC PhoneNumber=123 } Address { Pin=500 } I tried public Properties readConfiguration() { File configFile1 = new File("config.properties"); try { FileReader reader = new FileReader(configFile1); Properties props = new Properties(); props.load(reader); reader.close(); return props; } catch (FileNotFoundException ex) { // file does not exist } catch (IOException...
Read More

PHP imap_fetchbody can't get HTML a tag link url

Leave a Comment
I'm building a email read script, it read emails via imap, when i try to read email body using imap_fetchbody it only show texts, but email body have one link it seems not show, This is my code $hostname = '{mail.test.com/notls}INBOX'; $username = 'info@test.com'; $password = 'testopw'; /* try to connect */ $inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Email Server: ' . imap_last_error());...
Read More

SQL Server: Record size larger than expected

Leave a Comment
My table consists of 3 columns | Column Name | Data Type | Size | Value | real | 4 | LogId | int | 4 | SigId | smallint | 2 One primary key is set for columns LogId, SigId. The sum of all size's is 4+4+2=10, however using sys.dm_db_index_physical_statsI get, that the average (and min/max) record size in bytes is 25. Can someone explain? Am I comparing apples and oranges? 1 AnswersAnswers 1 The physical record length includes row overhead in addition to the space needed for the actual...
Read More

Friday, December 29, 2017

How to use TypeScript with Vue.js and Single File Components?

Leave a Comment
I have searched all over the web for a minimal, working example of a Vue.js + TypeScript setup. As per usual with the "modern JavaScript stack", most of these tutorials are either out-of-date despite being written just a couple of months ago or depending on a very specific setup. There appears to be no generic, verifiable example to build on. Here are some of the resources I considered: https://vuejs.org/v2/guide/typescript.html https://herringtondarkholme.github.io/2016/10/03/vue2-ts2/ http://www.mindissoftware.com/Vue-Sample-in-Typescript/...
Read More

How do I make JavaFX's webview render even when not visible due to being in another tab?

Leave a Comment
I'm loading a website on a JavaFX WebView and after a while taking a screenshot with something like: WritableImage image = webView.snapshot(null, null); If I'm looking at that WebView that works fine, but if it's hidden by being in a tab that is not in the foreground (I'm not sure about other cases of hiding it), then, the screenshot is of the appropriate site, but entirely blank. How can I force the WebView to render even if not visible? During this time, webView.isVisible() is true. I found there's a method in WebView...
Read More

How to build 1 jar from 3 sub-modules by using gradle

Leave a Comment
I have: Android Studio 3 gradle 4.1 gradle tools 3: classpath 'com.android.tools.build:gradle:3.0.1' When I had one module and used gradle tools 2, I used: task makeJar(type: Copy) { def releaseFolder = new File('build/intermediates/bundles/release/') if (releaseFolder.exists()) { from('build/intermediates/bundles/release/') } else { from('build/intermediates/bundles/default/') } into('build/outputs/jar/') include('classes.jar') rename ('classes.jar', 'MY-Android-SDK.jar')...
Read More

Thursday, December 28, 2017

Why are numpy functions so slow on pandas series / dataframes?

Leave a Comment
Consider a small MWE, taken from another question: DateTime Data 2017-11-21 18:54:31 1 2017-11-22 02:26:48 2 2017-11-22 10:19:44 3 2017-11-22 15:11:28 6 2017-11-22 23:21:58 7 2017-11-28 14:28:28 28 2017-11-28 14:36:40 0 2017-11-28 14:59:48 1 The goal is to clip all values with an upper bound of 1. My answer uses np.clip, which works fine. np.clip(df.Data, a_min=None, a_max=1) array([1,...
Read More