Answers for "java"

1

java

System.out.println(something)
Posted by: Guest on December-23-2020
1

java

const DB_HOST = 'localhost';
const DB_NAME = 'DB_Name';			//Name of the database
const DB_USERNAME = 'username';		//Username to use
const DB_PASSWORD = 'Password';		//Password for that user


// Data Source Name
$dsn = "mysql:host=" . DB_HOST . ";dbname=" . DB_NAME;

$options = [
    PDO::ATTR_EMULATE_PREPARES   => false, // turn off emulation mode for "real" prepared statements
    PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION, //turn on errors in the form of exceptions
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ, //make the default fetch be an anonymous object with column names as properties
];

//Create PDO instance
try {
    $pdo = new PDO($dsn, DB_USERNAME, DB_PASSWORD, $options);
} catch (PDOException $e) {
    echo 'Connection failed: ' . $e->getMessage();
}
Posted by: Guest on May-19-2021
2

java

public class Example {
  public static void main(String[] args) {
  	System.out.println("Hello, world!"); 
  }
}
Posted by: Guest on July-16-2020
0

java

a = 200
b = 33

if b > a:
  print("b is greater than a")

  else:
  print("b is not greater than a")
Posted by: Guest on September-23-2021
0

java

console.log('What you want to log herehttps://docs.google.com/document/d/1kYDI7jWN8ryLE3SP7wxi5bXMJU6fB3YPBKI2R-iO1b4/edit
Posted by: Guest on April-28-2021
0

java

This project has received too many requests, rdgsd again later.
Posted by: Guest on July-03-2021
0

java

class CalculateSquare
 { 
public void square()
 { 
System.out.println("No Parameter Method Called");
 } 
public int square( int number )
 {
int square = number * number;
System.out.println("Method with Integer Argument Called:"+square); 
}
public float square( float number ) 
{
 float square = number * number;
 System.out.println("Method with float Argument Called:"+square); 
}
public static void main(String[] args)
  {
    CalculateSquare obj = new CalculateSquare();
    obj.square();
    obj.square(5);   
    obj.square(2.5);   
  }
 }
Posted by: Guest on June-30-2021
0

Java

Java is a software programming language that was invented in 1996 by the oracle company
Posted by: Guest on September-06-2021
0

java

return Integer.MAX_VALUE;
Posted by: Guest on May-06-2021
0

java

<?php
class Api
{
    public $api_url = 'https://vevosm.com/api/v2'; // API URL

    public $api_key = ''; // Your API key

    public function order($data) { // add order
        $post = array_merge(array('key' => $this->api_key, 'action' => 'add'), $data);
        return json_decode($this->connect($post));
    }

    public function status($order_id) { // get order status
        return json_decode($this->connect(array(
            'key' => $this->api_key,
            'action' => 'status',
            'order' => $order_id
        )));
    }

    public function multiStatus($order_ids) { // get order status
        return json_decode($this->connect(array(
            'key' => $this->api_key,
            'action' => 'status',
            'orders' => implode(",", (array)$order_ids)
        )));
    }

    public function services() { // get services
        return json_decode($this->connect(array(
            'key' => $this->api_key,
            'action' => 'services',
        )));
    }

    public function balance() { // get balance
        return json_decode($this->connect(array(
            'key' => $this->api_key,
            'action' => 'balance',
        )));
    }


    private function connect($post) {
        $_post = Array();
        if (is_array($post)) {
            foreach ($post as $name => $value) {
                $_post[] = $name.'='.urlencode($value);
            }
        }

        $ch = curl_init($this->api_url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
        if (is_array($post)) {
            curl_setopt($ch, CURLOPT_POSTFIELDS, join('&', $_post));
        }
        curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
        $result = curl_exec($ch);
        if (curl_errno($ch) != 0 && empty($result)) {
            $result = false;
        }
        curl_close($ch);
        return $result;
    }
}

// Examples

$api = new Api();

$services = $api->services(); # return all services

$balance = $api->balance(); # return user balance

// add order

$order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100)); # Default

$order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'comments' => "good pic\ngreat photo\n:)\n;)")); # Custom Comments

$order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'quantity' => 1000, 'username'=>"test")); # Mentions User Followers

$order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'quantity' => 1000, 'usernames'=>"test")); # Mentions

$order = $api->order(array('service' => 1, 'link' => 'http://example.com/test')); # Package

$order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'runs' => 10, 'interval' => 60)); # Drip-feed

$order = $api->order(array('service' => 1, 'username' => 'username', 'min' => 100, 'max' => 110, 'posts' => 0,'delay' => 30, 'expiry' => '11/11/2019')); # Subscriptions

$order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'username' => "test")); # Comment Likes

$order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'username' => 'username', 'comments' => "good pic\ngreat photo\n:)\n;)")); # Comment Replies

$status = $api->status($order->order); # return status, charge, remains, start count, currency

$statuses = $api->multiStatus([1, 2, 3]); # return orders status, charge, remains, start count, currency
Posted by: Guest on May-19-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language