Skip to content

Instantly share code, notes, and snippets.

View quangnguyenbh's full-sized avatar

Quang Nguyen quangnguyenbh

View GitHub Profile
BOOL APCheckIfAppInstalled(NSString *bundleIdentifier)
{
static NSString *const cacheFileName = @"com.apple.mobile.installation.plist";
NSString *relativeCachePath = [[@"Library" stringByAppendingPathComponent: @"Caches"] stringByAppendingPathComponent: cacheFileName];
NSDictionary *cacheDict = nil;
NSString *path = nil;
// Loop through all possible paths the cache could be in
for (short i = 0; 1; i++)
{
@quangnguyenbh
quangnguyenbh / TheSumOfThree.rb
Last active December 17, 2015 19:09
Q. Write a O(N^2) function that takes as input an array of N integers, return a bool to indicate whether there are three integers in the array such that the sum of the three is zero.
1. Sort the array A[1..n] incrementally.
2.
process ( A[1..n])
begin
if(n < 3)
return false
else if (A[1] > 0 or A[n] < 0 )
return false
else if (A[1] + 2A[n] < 0)
return process(A[2..n])
deb http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu trusty main
deb-src http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu trusty main
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /JioMobileWS/rest/pharmacy/orders/21. Reason:
<pre> Server Error</pre></p><h3>Caused by:</h3><pre>javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
"<!doctype html>\n<html class=\"no-js\">\n <head>\n <meta charset=\"utf-8\">\n <title>General Check-Up Details</title>\n\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"description\" content=\"\">\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n\n <link href=\"https://www.google-analytics.com\" rel=\"dns-prefetch\">\n <link href=\"https://ajax.googleapis.com\" rel=\"dns-prefetch\">\n <link href=\"https://s3.amazonaws.com/jio-static/service-description/assets/css/style.min.css\" rel=\"stylesheet\">\n\n </head>\n <body>\n <main class=\"main\" role=\"main\">\n <div class=\"service-description-v2\">\n <div class=\"general-checkup-details-v2 wrapper\">\n <div class=\"top-content\">\n <img src=\"https://cdn.jiohealth.com/service-description/assets/img/v2/generalCareOverviewImage@2x.png\">\n <div class = \"content\">\n <div class=\"title\">Service Overview</div>\n <
"<!doctype html>\n<html class=\"no-js\">\n <head>\n <meta charset=\"utf-8\">\n <title>Annual Health Check-Up</title>\n\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"description\" content=\"\">\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n\n <link href=\"https://www.google-analytics.com\" rel=\"dns-prefetch\">\n <link href=\"https://ajax.googleapis.com\" rel=\"dns-prefetch\">\n <link href=\"https://s3.amazonaws.com/jio-static/service-description/assets/css/style.min.css\" rel=\"stylesheet\">\n\n </head>\n <body>\n <main class=\"main\" role=\"main\">\n <div class=\"service-description-v2\">\n <div class=\"annual-health-checkup-details-v2 wrapper\">\n <div class=\"top-content\">\n <img src=\"https://s3.amazonaws.com/jio-static/service-description/assets/img/v2/annualOverviewImage.png\">\n <div class=\"big-title\">Service Overview</div>\n <div class = \"content\">\n
{
"success": true,
"message": "",
"userID": 11397,
"firstName": "Hang301",
"lastName": "Dotesting",
"imageURL": "https://s3.amazonaws.com/JioHealth/devUserProfileImage/11397/fd16f6fa-6046-47ee-9a93-13ea3ebb640a?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20180607T045129Z&X-Amz-SignedHeaders=host&X-Amz-Expires=25710&X-Amz-Credential=AKIAIS5WQT5UVHQGOZ5Q%2F20180607%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=820fbdb986a0fe382fbeb3cb5def2348b032b9af6876467dbdd8b61491049585",
"medDegree": "Bác sỹ Đa Khoa",
"medDegreeID": 13,
"medSchool": {
<!DOCTYPE html>
<!--
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.3.6
Version: 4.5.3
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Follow: www.twitter.com/keenthemes
Like: www.facebook.com/keenthemes
Purchase: http://themeforest.net/itemassets/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
{
"success": true,
"message": "",
"data": {
"totalRecords": 2,
"products": [
{
"ePProductVarietyID": 3,
"title": "Advil Pain Reliever",
"subTitle": "Ibuprofen, 200mg",
from locust import HttpLocust, TaskSet, task
import random
import json
class EventAPITasks(TaskSet):
def on_start(self):
with self.client.post("/api/user/register", {
'username': self.locust.username,
'password': self.locust.password