Dynamic Adsense Insertion With JavaScript

The simple technique used to asynchronously load the AdSense script proposed by other answers won’t work because Google uses document.write() inside of the AdSense script. document.write() only works during page creation, and by the time the asynchronously loaded script executes, page creation will have already completed. To make this work, you’ll need to overwrite document.write() … Read more

Free JSON formatted stock quote API (live or historical) [closed]

Check the following they are free, they generate Json, though for different exchanges you need to ensure that correct syntax is used. even Yahoo finance works well, but it has some issues regarding NSE and BSE data, which is always generated Null DEPRECATEDGoogle Finance – NSE URL – http://www.google.com/finance/info?q=NSE:AIAENG,ATULAUTO,<Add more NSE codes> DEPRECATED Google Finance … Read more

How to kill processes by name? (Win32 API)

Try below code, killProcessByName() will kill any process with name filename : #include <windows.h> #include <process.h> #include <Tlhelp32.h> #include <winbase.h> #include <string.h> void killProcessByName(const char *filename) { HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, NULL); PROCESSENTRY32 pEntry; pEntry.dwSize = sizeof (pEntry); BOOL hRes = Process32First(hSnapShot, &pEntry); while (hRes) { if (strcmp(pEntry.szExeFile, filename) == 0) { HANDLE hProcess = … Read more

Gmail API Error from Code Sample – a bytes-like object is required, not ‘str’

Found a solution, replace this line: return {‘raw’: base64.urlsafe_b64encode(message.as_string())} with: return {‘raw’: base64.urlsafe_b64encode(message.as_string().encode()).decode()} Notice added .encode() and .decode() method calls. First, str object is encoded to bytes object – base64.urlsafe_b64encode requires it in Python 3 (compared to str object in Python 2). Then, the base64 encoded bytes object must be decoded back to str. This … Read more

How should I implement ExecuteAsync with RestSharp on Windows Phone 7?

Old question but if you are using C# 5 you can have a generic execute class by creating a TaskCompleteSource that resturns a Task of T. Your code could look like this: public Task<T> ExecuteAsync<T>(RestRequest request) where T : new() { var client = new RestClient(); var taskCompletionSource = new TaskCompletionSource<T>(); client.BaseUrl = BaseUrl; client.Authenticator … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)