Skip to content

Instantly share code, notes, and snippets.

View IshamMohamed's full-sized avatar
:shipit:
() => {}

Isham Mohamed IshamMohamed

:shipit:
() => {}
View GitHub Profile
@IshamMohamed
IshamMohamed / Function_getCurrencyCode.vb
Created January 5, 2013 18:22
A visual basic method for get currency code for various apps using google finance. If we put the currency values in a combo box, we can use this function with SelectedIndex() method of the combo box eg : fromCurrency = getCurrencyCode(toCurrencyListCombo.SelectedIndex)
Private Function getCurrencyCode(ByVal selectedIndex As Integer) As String
Dim str As String = ""
selectedIndex += 1
Select Case selectedIndex
Case 1
str = "AED"
Case 2
str = "ANG"
Case 3
str = "ARS"
@IshamMohamed
IshamMohamed / mtk_custom_usb.h
Created May 18, 2013 17:41
Custom USB kernal code for MTK USB device.
#ifndef MTK_USB_CUSTOM_H
#define MTK_USB_CUSTOM_H
/* Force full-speed is not guaranteed with adb function, use it with care! */
//#define USB_FORCE_FULL_SPEED
#define USB_MS_PRODUCT_ID 0x0001
#define USB_MS_ADB_PRODUCT_ID 0x0c03
#define USB_RNDIS_PRODUCT_ID 0x0003
#define USB_RNDIS_ADB_PRODUCT_ID 0x0004
@IshamMohamed
IshamMohamed / SampleMeaningsCodeOne.py
Last active December 29, 2015 01:59
This is a sample Python code impementation of Meanings API of Easy APIs Project (http://gcdc2013-easyapisproject.appspot.com/)
import urllib2
#read response for word 'Excitement'
response = urllib2.urlopen('http://gcdc2013-easyapisproject.appspot.com/meanings?q=excitement')
html = response.read()
html = html[1:] #remove first {
html = html[:-1] #remove last }
html = html.split('}{') #split with '}{'
print html[0] #Print 1st result
print html[1] #Print 2ns result
@IshamMohamed
IshamMohamed / MeaningsAPI.py
Created November 22, 2013 10:27
This is a Python implementation of Meanings API from Easy APIs Project (http://gcdc2013-easyapisproject.appspot.com/) to get input from user and give meanings.
import urllib2
print "Enter a word:",
q = raw_input() #get word from user
response = urllib2.urlopen('http://gcdc2013-easyapisproject.appspot.com/meanings?q='+q)
html = response.read()
html = html[1:] #remove first {
html = html[:-1] #remove last }
html = html.split('}{') #split and put each resutls to array
for meanings in html:
print meanings
@IshamMohamed
IshamMohamed / WeatherAPI.py
Last active December 29, 2015 02:09
Easy APIs Project (http://gcdc2013-easyapisproject.appspot.com/) Weather API implementation in Python
# -*- coding: utf-8 -*-
import urllib
import urllib2
def celsius(a):
responsex = urllib2.urlopen('http://gcdc2013-easyapisproject.appspot.com/unitconversion?q=' + urllib.quote(a + ' in celsius'))
html = responsex.read()
responsex.close()
html = html[1:] #remove first {
html = html[:-1] #remove last }
using System.Net;
//this method can be called in a button tap event
private void calculate()
{
string calculationText = txtInput.Text;
try
{
WebClient wc = new WebClient();
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<button onclick="getWeather(31.12819929911196,84.55078125,function (data) {
console.log('weather data received');
314159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679
82148086513282306647093844609550582231725369154495
87196202546254399102534602031340359642843665440272
12069215943595139508012475692954599679411918121173
42942063040293577778783047052931650057536697320417
07972854902135844325625298889420641258066664202073
68475692618677620816824692229984289511080718876068
32100239939757234316322022119788183517677868967303
19141416286753270466001648497435820992474374991568
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
namespace PrintPI
{
class Program
public MainPage()
{
InitializeComponent();
startBackgroundMusic();
}
private void startBackgroundMusic()
{
this.Dispatcher.BeginInvoke(() =>
{