Skip to content

Instantly share code, notes, and snippets.

View Mandar-Shinde's full-sized avatar

Mandar Shinde Mandar-Shinde

View GitHub Profile
@Mandar-Shinde
Mandar-Shinde / 0_reuse_code.js
Created October 11, 2015 13:32
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Mandar-Shinde
Mandar-Shinde / Qt_SetDatetime.cpp
Created November 19, 2015 07:08
Qt Set Datetime
#include <QCoreApplication>
#include <qdatetime.h>
#include <windows.h>
// QT 5.4 - Console Application
// (RUN AS ADMINISTRATOR)
//
int main(int argc, char *argv[])
{
@Mandar-Shinde
Mandar-Shinde / Win32RegistryDelete.cpp
Created November 19, 2015 09:48
WinAPI Registry Delete
//
// Delete Registry (64bit machine - 64bit Registry)
//
HKEY hKey = NULL;
long lReturn = RegOpenKeyEx( HKEY_LOCAL_MACHINE,(L"SOFTWARE\\coderbox\\Boost"),0L,KEY_WRITE| KEY_WOW64_64KEY,&hKey );
if (lReturn == ERROR_SUCCESS)
{
lReturn = RegDeleteValueW(hKey, (L"OpenGL"));
RegCloseKey(hKey);
@Mandar-Shinde
Mandar-Shinde / Qt_RunTime_UI.cpp
Created December 1, 2015 14:28
Qt Runtime GUI
// Main Widget
QWidget *mainAppWindow = new QWidget;
mainAppWindow->setWindowTitle("Runtime GUI");
mainAppWindow->setFixedSize(200, 300);
// Parent layout
QVBoxLayout *layoutParent= new QVBoxLayout();
// List of items
@Mandar-Shinde
Mandar-Shinde / clearworkingset.cpp
Last active December 14, 2015 13:25
Clear Memory Working Set
//
// Removes as many pages as possible from the working set of the current process.
// Library: Psapi.h
//
if(EmptyWorkingSet(GetCurrentProcess()))
{
// Cleared up some working set
}
else
@Mandar-Shinde
Mandar-Shinde / tinyXML.cpp
Created December 22, 2015 17:33
TinyXML Sample
#include "tinyxml2.h"
using namespace tinyxml2;
using namespace std;
//<EMAIL>
// <HEADER>
// <TO>
// </TO>
@Mandar-Shinde
Mandar-Shinde / mp3.c
Created January 3, 2016 16:51 — forked from wh5a/mp3.c
CUDA Matrix Multiplication with Shared Memory
// MP 2: Due Sunday, Dec 16, 2012 at 11:59 p.m. PST
#include <wb.h>
#define wbCheck(stmt) do { \
cudaError_t err = stmt; \
if (err != cudaSuccess) { \
wbLog(ERROR, "Failed to run stmt ", #stmt); \
return -1; \
} \
} while(0)
@Mandar-Shinde
Mandar-Shinde / RemoveTrayPin.cs
Created February 4, 2016 08:35
Reloads Taskbar
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Threading;
namespace RemoveTrayPin
@Mandar-Shinde
Mandar-Shinde / gist:fbb01ce0d16ae6871b77
Created February 10, 2016 06:16 — forked from mejibyte/gist:1268711
My implementation of the Knuth-Morris-Pratt algorithm in C++
// http://www.spoj.pl/problems/NHAY/
#include <vector>
#include <iostream>
#include <string>
#include <cstdio>
using namespace std;
void kmp(const string &needle, const string &haystack) {
int m = needle.size();
vector<int> border(m + 1);
@Mandar-Shinde
Mandar-Shinde / WindowsEventLog.cpp
Created December 30, 2016 11:52
C++ Query Event Viewer Data
#include <windows.h>
#include <sddl.h>
#include <stdio.h>
#include <winevt.h>
#pragma comment(lib, "wevtapi.lib")
const int SIZE_DATA = 4096;
TCHAR XMLDataCurrent[SIZE_DATA];