Posts

Showing posts from September 18, 2018

Selenium is unable to extract page source and returning empty body of html page

Image
Clash Royale CLAN TAG #URR8PPP Selenium is unable to extract page source and returning empty body of html page Here is my python code: import pandas as pd import pandas_datareader.data as web import bs4 as bs import urllib.request as ul from selenium import webdriver style.use('ggplot') driver = webdriver.PhantomJS(executable_path='C:\Phantomjs\bin\phantomjs.exe') def getBondRate(): #driver.deleteAllCookies(); url = "https://www.marketwatch.com/investing/index/tnx?countrycode=xx" driver.get(url) driver.implicitly_wait(10) html = driver.page_source return html bondRate = getBondRate() print(bondRate) Few days back it was reading perfectly fine from Market watch. Now it is returning nothing in Body tag. Is selenium not loading page? 2 Answers 2 Do you require the HTML tags also? If not, you can try retrieving using the body tag. Here's how I would do it using Java. String src=driver.findElement(By.tagName("body")).getText(); As per t

How can we change appbar background color in flutter

Image
Clash Royale CLAN TAG #URR8PPP How can we change appbar background color in flutter i am trying to set common theme for app so i need to change appbar color as color that indicate hexcode #0f0a1a const MaterialColor toolbarColor = const MaterialColor( 0xFF151026, const <int, Color>0: const Color(0xFF151026)); i try this piece of code to make a custom color but fails. How can i do this from themeData? how it fails ? any errors ? – Raouf Rahiche Aug 8 at 7:05 NoSuchMethodException shown in emulator. does primarycolor need materialColor? – Vineeth Mohan Aug 8 at 7:19 check my Answer – Raouf Rahiche Aug 8 at 7:26 1 Answer 1 declare your Color like this const PrimaryColor = const Color(0xFF151026); and then in the MaterialApp level( will change the AppBar Color in the whole app ) change the PrimaryColor MaterialApp PrimaryColor return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primaryColor: PrimaryColor, ), home: MyApp(), ); an

Reusing identifiers in a trigger function in PostgreSQL

Image
Clash Royale CLAN TAG #URR8PPP Reusing identifiers in a trigger function in PostgreSQL I am using PostgreSQL 9.2.23. I have a trigger function that has a number of statements that reuse the same identifiers in the format statement. I'll just include one execute statement for brevity. CREATE OR REPLACE FUNCTION update_lookup_table() RETURNS trigger AS $BODY$ DECLARE arg_key text; arg_desc text; arg_table text; BEGIN arg_key := TG_ARGV[0]; arg_desc := TG_ARGV[1]; arg_table := TG_ARGV[2]; EXECUTE format('DROP TABLE IF EXISTS %s', quote_ident('temp_' || arg_table)); EXECUTE format('CREATE TEMPORARY TABLE %s(%I text, %I text)', quote_ident('temp_' || arg_table), arg_key, arg_desc); EXECUTE format('INSERT INTO %s(%I, %I) SELECT DISTINCT %I, %I from staging_staff', quote_ident('temp_' || arg_table), arg_key, arg_desc, arg_key, arg_desc); EXECUTE format('LOCK TABLE %I IN EXCLUSIVE MODE', arg_table); EXECUTE forma

Is there distinction between the commands understood by the MySQL client and understood by the MySQL server?

Image
Clash Royale CLAN TAG #URR8PPP Is there distinction between the commands understood by the MySQL client and understood by the MySQL server? When using MySQL in command line (such as Bash), is there a similar distinction between PostgreSQL server and client psql? If yes, what are the MySQL client and MySQL server when I run mysql in a OS shell? I never see in MySQL document a distinction between MySQL client/shell and MySQL server. mysql is there distinction between the commands understood by the MySQL client and understood by the MySQL server? For comparison, in Postgresql, psql has its own commands usually started with , such as l , while postgresql server only understands SQL commands and doesn't understand psql commands. In MySQL official document, I don't find it mentions whether a command is only understood by the MySQL client or by the MySQL server. l Thanks. 1 Answer 1 The command line client mysql also has commands that are interpreted by the client program

how can i create a alert popup message in vb?

Image
Clash Royale CLAN TAG #URR8PPP how can i create a alert popup message in vb? how can i create a popup alert message in vb when my button is click. ? your help is much appreciated! here is my page load code looks like: Imports System.Net.Mail Imports System.IO Imports System.Text Public Class locker Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Request.IsAuthenticated Then WelcomeBackMessage.Text = "Welcome back!" AuthenticatedMessagePanel.Visible = True AnonymousMessagePanel.Visible = True Else AuthenticatedMessagePanel.Visible = False AnonymousMessagePanel.Visible = True End If Dim ident As FormsIdentity = CType(User.Identity, FormsIdentity) Dim authTicket As FormsAuthenticationTicket = ident.Ticket WelcomeBackMessage.Text = "Welcome, " & User.Identity.Name & "!" End Sub Protected Sub send_Click(sender As Object, e As EventArgs) Handles send.Click <

In App Billing Library doesn't provide the Updated PurchaseList after Consuming the Purchase Item?

Image
Clash Royale CLAN TAG #URR8PPP In App Billing Library doesn't provide the Updated PurchaseList after Consuming the Purchase Item? I am currently Implementing in App Purchase using In App Billing Library, After Consuming the Purchased Item using method : mBillingClient.consumeAsync(purchaseToken, new ConsumeResponseListener() @Override public void onConsumeResponse(int responseCode, String purchaseToken) if (responseCode == BillingClient.BillingResponse.OK) Toast.makeText(getApplicationContext(), "Item Consumed Successfully..." + purchaseToken, Toast.LENGTH_LONG).show(); ); break; when I open the app again and want to Retrieve the list of the Purchases List using the Method: mBillingClient.queryPurchaseHistoryAsync(BillingClient.SkuType.INAPP, new PurchaseHistoryResponseListener() @Override public void onPurchaseHistoryResponse(int responseCode, List<Purchase> purchasesList) if (responseCode == BillingClient.BillingResponse.OK) purchases = purchasesLi

Insert if nothing exists [duplicate]

Image
Clash Royale CLAN TAG #URR8PPP Insert if nothing exists [duplicate] This question already has an answer here: I want to insert rows if nothing exists in a table. Something like that: WHEN NOT EXISTS (SELECT * FROM Students) THEN INSERT INTO Students (name) VALUES ("Foo Bar"), ("Bar Foo") But it causes Error: SQLITE_ERROR: near "WHEN": syntax error Error: SQLITE_ERROR: near "WHEN": syntax error This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. 1 Answer 1 You could use: INSERT INTO Students (name) SELECT 'Foo Bar' AS name WHERE NOT EXISTS (SELECT * FROM Students);

Java interface implementation?

Image
Clash Royale CLAN TAG #URR8PPP Java interface implementation? I'm newbie to Java. I would like to ask different between the following interface examples? public interface MyInterface public void doSomething(); like this public class MyClass implements MyInterface public void doSomething .... and this public class MyClass implements MyInterface protected MyInterface myInterface; public MyClass (MyInterface myInterface) this.myInterface = myInterface; public void doSomething () myInterface.doSomething(); why would you want to do it the second way? How would you create an MyInterface to pass to your constrcutor? What would any benefit be? – Scary Wombat Aug 8 at 4:24 MyInterface Interface can have multiple implementations. Therefore it is possible to get different implementation calls at runtime – Jude Niroshan Aug 8 at 4:25 5 Answers 5 public class MyClass implements MyInterface public void doSomething .... MyClass implements the interface MyInterface.

jquery datatable disable sort in specific row

Image
Clash Royale CLAN TAG #URR8PPP jquery datatable disable sort in specific row How to disable sorting in specific row/column in jquery datatable using a class? here's my sample table; <table> <thead> <tr> <th class="sorting_disabled">Title1</th> <th class="">Title2</th> <th class="sorting_disabled">Title3</th> </tr> </thead> <tbody> <tr><td>Tag 1</td><td>Date 1</td><td>Date 2</td></tr> <tr><td>Tag 2</td><td>Date 2</td><td>Date 2</td></tr> <tr><td>Tag 3</td><td>Date 3</td><td>Date 3</td></tr> <tr><td>Tag 4</td><td>Date 4</td><td>Date 4</td></tr> <tr><td>Tag 5</td><td>Date 5</td><td>Date 5</td></tr> .... </tbody> </table&g

Untiy , how to disable log message from google play game service plugin

Image
Clash Royale CLAN TAG #URR8PPP Untiy , how to disable log message from google play game service plugin These log message are so annoying. It show every time i hit play button on Unity. How to disable it? if you double click on the log does it take you to the source file where a debug.log is called? if so just comment it out/delete it. If it doesn't and its tucked away in some dll then i don't think you can do a whole lot about it – remy_rm Aug 8 at 8:16 @remy_rm i have tried double on it. it didn't go anywhere. – Tkaewkunha Aug 8 at 8:45 I'm afraid its packed into a .dll then, which you cannot edit unless you have the unpacked source code.. I don't think there is a way to stop these logs from showing up then. Someone may correct me on this. – remy_rm Aug 8 at 8:55 @remy_rm thank you. – Tkaewkunha Aug 8 at 9:08 @remy_rm Nope. There is a way to do so – Programmer Aug 8 at 14:28 By clicking "Post Your Answer", you ac

XML Parsing Error - XmlHttpObj is null

Image
Clash Royale CLAN TAG #URR8PPP XML Parsing Error - XmlHttpObj is null Since moving to a https server and updating code, I'm having problems with cascading dropdown boxes that were previously working. I get an XML Parsing Error: no element found, as well as an error telling me that XmlHttpObj.responseXML is null. I have had some errors relating to updating the mysqli sections, and from what I have been able to work out I think the problem might be with the query. However, this is the same query that I have been using, and which has been working fine. So, I'm really not sure what is wrong here. Ajax function causing error: function StateChangeHandler() // state ==4 indicates receiving response data from server is completed if(XmlHttpObj.readyState == 4 && XmlHttpObj.status == 200) populateCbo(XmlHttpObj.responseXML.documentElement); XML page which is returning the null value: <?php // simple data provider for a cascading dropdown Header("Content-type:

Code Comparison in Oracle DB and SVN

Image
Clash Royale CLAN TAG #URR8PPP Code Comparison in Oracle DB and SVN I need a help of Tool or script that I can check If I can compare the Oracle DB files that are committed to SVN or Not? I need to check the compiled files in Oracle only. Can anyone help me on this? Thanks, Dhaval. What do you mean with "Oracle DB files"? – Wernfried Domscheit Aug 8 at 6:18 Wernfried, our Schema SQL files or ddl files etc. – dhaval shah Aug 8 at 6:22 So as I have understand you have files on your machine and you want to check if they are on svn right ? so you can check out the scripts from svn localy to a folder then compare the 2 folder (there many free tool on the internet or you can develop a your own tool) the one are missing you put them in one folder then search fo there contents – Moudiz Aug 8 at 7:23 check out Never mention "Tool or script" in SO. It is off-topic and will most likely to be voted to close. – Kaushik Nayak Aug 8 at 8:14 1 An

Segmentation Fault when allocating memory to a pointer to pointer variable [C] [closed]

Image
Clash Royale CLAN TAG #URR8PPP Segmentation Fault when allocating memory to a pointer to pointer variable [C] [closed] I'm trying to represent an array of strings by using a pointer to pointer. So I've defined char** arr as below: char** arr uint8_t lines = getLines(); char** arr = malloc (sizeof (char*) * lines); // char** arr = malloc (sizeof (char*) * ROWS_COUNT); In the debug process, the line above will be executed successfully and allocates memory to arr . The problem (and so, the error) issues when trying to allocating enough memory to hold a string within *(arr + 0) as below: arr *(arr + 0) // #define PATH_MAX 4096 *arr = malloc (sizeof (char) * (PATH_MAX + 1)); Runtime Error: Signal: SIGSEGV (Segmentation fault) Note: I've used casting operators (the first assignment by char** and the second one by char* ). It doesn't work too. char** char* Note: I've used ROW_COUNTS here for the sake of simplicity. In the original code, there is a lines variabl

Idris Lightyear requireFailure does not do backtracking

Image
Clash Royale CLAN TAG #URR8PPP Idris Lightyear requireFailure does not do backtracking I want to parse a series of any 4 chars. However, these chars shouldn't form a specific string ( "bb" in an example below). So "aaaa" and "abcd" are okay, but neither "bbcd" nor "abbc" should not match. "bb" "aaaa" "abcd" "bbcd" "abbc" I composed a following parser: ntimes 4 (requireFailure (string "bb") *> anyChar) However, I noticed, that it "eats" single b chars. E.g. b parse (ntimes 4 (requireFailure (string "bb") *> anyToken)) "abcde" results in ['a', 'c', 'd', 'e'] (it fails, however, on "bbcd" and "abbc" as expected). ['a', 'c', 'd', 'e'] "bbcd" "abbc" As a workaround I used my own implementation of requireFailure : requireFailur

Find Pythagorean triplet for which a + b + c = 1000

Image
Clash Royale CLAN TAG #URR8PPP Find Pythagorean triplet for which a + b + c = 1000 A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a 2 + b 2 = c 2 For example, 3 2 + 4 2 = 9 + 16 = 25 = 5 2 . There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc. Source : http://projecteuler.net/index.php?section=problems&id=9 I tried but didn't know where my code went wrong. Here's my code in C: #include <math.h> #include <stdio.h> #include <conio.h> void main() int a=0, b=0, c=0; int i; for (a = 0; a<=1000; a++) for (b = 0; b<=1000; b++) for (c = 0; c<=1000; c++) if ((a^(2) + b^(2) == c^(2)) && ((a+b+c) ==1000))) printf("a=%d, b=%d, c=%d",a,b,c); getch(); +1 just for the short snippet demonstrating the problem. – sharptooth May 12 '10 at 10:28 Needs homework tag though ? – Paul R May 12 '10 at 10:29 Do Project Euler quest