[Solved] Check a Website is Responsive or not using PHP [closed]

Thanks to @Alexander O’Mara for the suggestion. It’s little trick. Not 100% correct way. But working for all sites. <?php ini_set(‘user_agent’, ‘Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9’); $html = file_get_contents(“http://php.net/”); ini_set(‘user_agent’, ‘Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7’); $html2 … Read more

[Solved] Appium Test Android

First Time I miss to add two library’s in dependency dependencies { implementation fileTree(include: [‘*.jar’], dir: ‘libs’) implementation “org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version” implementation ‘com.android.support:appcompat-v7:28.0.0’ implementation ‘com.android.support:design:28.0.0’ implementation ‘com.android.support.constraint:constraint-layout:1.1.3’ implementation ‘com.android.support:support-vector-drawable:28.0.0’ testImplementation ‘junit:junit:4.12’ androidTestImplementation ‘com.android.support.test:runner:1.0.2’ androidTestImplementation ‘com.android.support.test.espresso:espresso-core:3.0.2’ implementation ‘com.github.armcha:SpaceNavigationView:1.6.0’ implementation files(‘libs/byte-buddy-1.8.15.jar’) implementation files(‘libs/commons-exec-1.3.jar’) implementation files(‘libs/guava-25.0-jre.jar’) implementation files(‘libs/java-client-7.0.0.jar’) implementation files(‘libs/okhttp-3.11.0.jar’) implementation files(‘libs/okio-1.14.0.jar’) implementation ‘com.android.support:multidex:1.0.3’ //missed implementation files(‘libs/client-combined-3.141.59.jar’) implementation files(‘libs/client-combined-3.141.59-sources.jar’) } … Read more

[Solved] Get substrings from an array rows, Regex? [closed]

$str=”2015/2016-0 5 Gruuu 105 Fac Cience Comm 10073 Com Aud 103032 Tech Real TV 4 First Time feb First Quad 6.0 1 Lory Johnson, Nicholas 1334968 47107453A Cory Stein, Hellen Monster Cr. pie 5 a 3-2 08704 Iguan NewYork [email protected] [email protected] 617788050 Si 105 / 968 17/07/2015 0″; Get 6 numbers: preg_match(‘~\d{6}~’, $str, $matches); print_r($matches); … Read more

[Solved] Returning a random string

Why do you include so many unneeded header files? These should be sufficient: #include <iostream> #include <string> #include <stdio.h> #include <stdlib.h> #include <time.h> You should avoid using namespace std;. If you don’t want to type std::string every time especially you can use using std::string; using std::string; using std::cout; using std::endl; Now to your function. To … Read more

[Solved] Writing basic BMI analysis program for python

your code should be like this: def calcBMI(weightlb, heightin): bmi = weightlb * 703/ heightin **2 return bmi def main(): weightlb = float(input(“Enter your weight in pounds: “)) heightin = float(input(“Enter your height in inches: “))` bmi = calcBMI(weightlb, heightin) print(“Your BMI is %f” %bmi) main() 1 solved Writing basic BMI analysis program for python

[Solved] jquery mobile & php

Here you go, fixed it: PAGE 1: index.html <!DOCTYPE html> <html> <head> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js”></script> <script src=”https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js”></script> <link rel=”stylesheet” href=”https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.css”> <script type=”text/javascript” src=”http://dev.jtsage.com/cdn/spinbox/latest/jqm-spinbox.min.js”></script> </head> <body> <div data-role=”page”> <h1 id=”header”>IT Cafe</h1> <a href=”#hot” data-role=”button” data-inline=”true” data-icon=”home” data-iconpos=”notext” id=”homeicon” ></a> <a href=”#shop” data-role=”button” data-inline=”true” data-icon=”shop” data-iconpos=”notext” id=”shopicon” ></a> <nav data-role=”navbar”> <ul> <li><a href=”#hot” class=”ui-btn-active ui-state-persist” >Coffee(Hot)</a></li> <li><a href=”#ice” … Read more

[Solved] Change two different parts in a table according to the same random value

This answer has the “I did it at work without Mathematica to check my syntax” advisory on it @belisarius’ answer works perfectly well, is more elegant, and is almost certainly more efficient than mine. But you might find an alternative that is easier for you to understand using the ArrayFlatten command (documentation) or the Join … Read more

[Solved] How can I respond to a keyboard chord and replace the entered alpha key with a special one?

Here’s one way to accomplish this for all TextBoxes on your Form: public partial class Form1 : Form { public Form1() { InitializeComponent(); } protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (this.ActiveControl != null && this.ActiveControl is TextBox) { string replacement = “”; TextBox tb = (TextBox)this.ActiveControl; bool useHTMLCodes = checkBoxUseHTMLCodes.Checked; if … Read more