This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Formula Calculator | |
formula = input("Enter the formula") | |
# 35 + 12 | |
# 47 | |
x = formula.find("+") | |
a = float(formula[:x]) | |
b = float(formula[x+1:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = float(input("Enter first number")) | |
y = float(input("Enter second number")) | |
o = input("Enter operator") # + - / * % | |
if o == "+": | |
print(x + y) | |
elif o == "-": | |
print(x - y) | |
elif o == "*": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = float(input("Enter first number")) | |
y = float(input("Enter second number")) | |
o = input("Enter operator") # + - / * % | |
if o == "+": | |
print(x + y) | |
elif o == "-": | |
print(x - y) | |
elif o == "*": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple JS code to convert a number into English Words. | |
// Copied from CodeSignal Solutions, Coded by psr < https://app.codesignal.com/profile/psr > | |
a = ` One Two Three Four Five Six Seven Eight Nine Ten Eleven Twelve Thirteen Fourteen`.split` ` | |
b = ` Twen Thir For Fif Six Seven Eigh Nine`.split` ` | |
w = ` Thousand Million Billion`.split` ` | |
f = integerToEnglishWords = ( | |
n, | |
k = 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var validate_egypt_mobile = (mobileStr) => { | |
return /^(010|012|011|015)[0-9]{8}$/.test(mobileStr); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// API access key from Google API's Console | |
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' ); | |
$registrationIds = array( $_GET['id'] ); | |
// prep the bundle | |
$msg = array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
D/AsyncHttpClient: Headers were overwritten! (Accept | application/json) overwrites (Accept | application/json) | |
W/DefaultRequestDirector: Authentication error: Unable to respond to any of these challenges: {} | |
V/AsyncHttpResponseHandler: Progress 993 from 993 (100%) | |
W/remoting.RestAdapter: HTTP request (string) failed: org.apache.http.client.HttpResponseException: Unauthorized | |
W/System.err: org.apache.http.client.HttpResponseException: Unauthorized | |
W/System.err: at com.loopj.android.http.AsyncHttpResponseHandler.sendResponseMessage(AsyncHttpResponseHandler.java:404) | |
W/System.err: at com.loopj.android.http.AsyncHttpRequest.makeRequest(AsyncHttpRequest.java:161) | |
W/System.err: at com.loopj.android.http.AsyncHttpRequest.makeRequestWithRetries(AsyncHttpRequest.java:178) | |
W/System.err: at com.loopj.android.http.AsyncHttpRequest.run(AsyncHttpRequest.java:109) | |
W/System.err: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UserRepository userRepo = adapter.createRepository(UserRepository.class); | |
userRepo.loginUser(email, password, new UserRepository.LoginCallback() { | |
@Override | |
public void onSuccess(AccessToken token, Object currentUser) { | |
} | |
public void onError(Throwable t) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var x = ['one', 'two', 'three']; | |
Array.prototype.indexOfRegex = function(regex) { | |
for(var i=0; i < this.length; i++) { | |
if(this[i].search(regex) > -1) | |
return i; | |
} | |
return -1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://facebook.com/code.we.bas | |
import socket | |
import sys | |
from thread import * | |
# Define HOST and PORT | |
HOST = '' # Host, Can be Empty to work on all available interfaces. | |
PORT = 8003 # Port to be used, must not be already used by another process. |