Posts

'Office' does not exist in the namespace 'Microsoft'

Image
Error: The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) Version: Microsoft Visual Studio 2013 Problem code: using Excel = Microsoft.Office.Interop.Excel; Solution: 1. Go to http://www.dllme.com/dll/files/microsoft_office_interop_excel_dll.html and download Microsoft.Office.Interop.Excel.dll (Size: 1.04 MB)

Plot a chart from CSV using JavaScript

Image
This tutorial demonstrates how to use a CSV file to plot a chart graph using DyGraph jQuery API which is a JavaScript. Dygraphs is a fast, flexible open source JavaScript charting library.It allows users to explore and interpret dense data sets. Check dygraphs tutorials and gallery for more. Here goes the code: < html > < head > < script type =" text/javascript " src =" /Scripts/dygraph-combined-dev.js "></ script > </ head > < body > < div id =" graphdiv2 " style =" width: 100%; height: 100%; "> </ div > < script type =" text/javascript "> g2 = new Dygraph( document.getElementById("graphdiv2"), "timecpu.csv", { xlabel: " Time (ms) --> ", ylabel: " Usage (%) -->", title: "Time vs System Load", showRangeSelector: true, rangeSelectorHeight: 3...

Current Total CPU Usage in Visual C++

Image
// Test_001.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <windows.h> #include <stdio.h> //------------------------------------------------------------------------------------------------------------------ // Prototype(s)... //------------------------------------------------------------------------------------------------------------------ CHAR cpuusage(void); //----------------------------------------------------- typedef BOOL ( __stdcall * pfnGetSystemTimes)( LPFILETIME lpIdleTime, LPFILETIME lpKernelTime, LPFILETIME lpUserTime ); static pfnGetSystemTimes s_pfnGetSystemTimes = NULL; static HMODULE s_hKernel = NULL; //----------------------------------------------------- void GetSystemTimesAddress() {     if( s_hKernel == NULL ) {         s_hKernel = LoadLibrary( L"Kernel32.dll" );         if( s_hKernel != NULL ) {   ...

Current Total CPU Usage in Dev-C++

Image
#include <windows.h> #include <stdio.h> //------------------------------------------------------------------------------------------------------------------ // Prototype(s)... //------------------------------------------------------------------------------------------------------------------ CHAR cpuusage(void); //----------------------------------------------------- typedef BOOL ( __stdcall * pfnGetSystemTimes)( LPFILETIME lpIdleTime, LPFILETIME lpKernelTime, LPFILETIME lpUserTime ); static pfnGetSystemTimes s_pfnGetSystemTimes = NULL; static HMODULE s_hKernel = NULL; //----------------------------------------------------- void GetSystemTimesAddress() {     if( s_hKernel == NULL ) {         s_hKernel = LoadLibrary( "Kernel32.dll" );         if( s_hKernel != NULL ) {             s_pfnGetSystemTimes = (pfnGetSystemTimes)GetProcAddress...

Install Visual C++ 2010 Express

Image
Visual C++ is one of the components of Visual Studio (others include Visual Web Developer for ASP.NET with C# or VB and etc.). Visual C++ 2010 Express is part of the Visual Studio 2010 Express family, a free set of tools that Windows developers at any level can use to create custom applications using basic and expert settings. Microsoft Visual C++ (often abbreviated as MSVC or VC++) is a commercial (free version available), integrated development environment (IDE) product from Microsoft for the C, C++, and C++/CLI programming languages. It features tools for developing and debugging C++ code, especially code written for the Microsoft Windows API, the DirectX API, and the Microsoft .NET Framework. Click this link for difference between C++ and (Microsoft) Visual C++ . You can get the software from here . It is a 3.16 MB file named vc_web.exe. [This is the only working source I could find when I googled for the setup, you may suggest any other sources if good enough!]

Dev-C++ Errors and Solutions

Image
Issue: [Error] 'ofstream' was not declared in this scope Problem code snippet: #include <iostream> #include <fstream> int main() {     ofstream myfile; // TO DO........     return 0; } Solution code snippet: #include <iostream> #include <fstream> using namespace std; int main() {     ofstream myfile; // TO DO........     return 0; }

50 Software Performance Analyzers (Profilers)

Image
What is Profiler? Most commonly, profiling information serves to aid program optimization. Profiling is achieved by instrumenting either the program source code or its binary executable form using a tool called a profiler (or code profiler). Reference: https://en.wikipedia.org/wiki/Profiling_%28computer_programming%29 Simply put, any tool or technique you use to analyze and optimize the performance can be called a profiler. How does Profilers work? Commonly used profilers simply examine the running program regularly to see what assembly instruction is currently being executed (the program counter) and which routines called the current function (the call stack). This kind of sampling profiler can work with standard binaries, but are more useful if you have debugging symbols to work out lines of code given addresses in the program.