Skip to content

Instantly share code, notes, and snippets.

View alexpana's full-sized avatar

Alexandru Pană alexpana

  • Transylvania, RO
View GitHub Profile
@alexpana
alexpana / Babe I'm Gonna Leave You
Created August 25, 2013 07:23
Tablature for the way Nicola Mandorino actually plays the song in his video
Babe I'm Gonna Leave You
by Led Zeppelin
This is the tablature for the way Nicola Mandorino actually plays the song
in his video: http://www.youtube.com/watch?v=1mz9gqGPXD8
All rights for the interpretation go to him. For more songs and lessons, visit
his website at http://www.guitarnick.com/index.html
/////////////////////////////////////////////////////////////////////////////
// Name: samples/drawing/drawing.cpp
// Purpose: shows and tests wxDC features
// Author: Robert Roebling
// Modified by:
// Created: 04/01/98
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@alexpana
alexpana / D2DPrintingFromDesktopApps.cpp
Created August 5, 2014 19:43
Direct2D printing sample
//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//// PARTICULAR PURPOSE.
////
//// Copyright (c) Microsoft Corporation. All rights reserved
#include "D2DPrintingFromDesktopApps.h"
#include <commdlg.h>
@alexpana
alexpana / profiling.cpp
Last active May 18, 2017 00:29
Profiling Direc2D vs GDI+ wxWidgets implementations
struct ProfileResult
{
long double d2dResultNoAA;
long double d2dResultAA;
long double gdiResultNoAA;
long double gdiResultAA;
};
ProfileResult ProfileDrawFunction(wxWindow* window, std::function<void(wxGraphicsContext*)> drawFunction)
{
@alexpana
alexpana / part1
Last active August 29, 2015 14:06
Nico
Public Class Form1
Private Sub TextBox2_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox2.TextChanged
End Sub
' Asta este o metoda / subrutina (subroutine) care este executata cand apesi pe butonul 1
' din cauza ca specifici "Handles Button1.Click"
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim number1 As Integer
Dim number2 As Integer
Dim number5 As Integer
@alexpana
alexpana / FindSDL2.cmake
Last active May 3, 2017 14:40
Getting started with CLion and SDL2 on Windows
# Find the include directory which contains SDL.h
FIND_PATH(SDL2_INCLUDE_DIR SDL.h HINTS $ENV{SDL2} PATH_SUFFIXES include/SDL2)
# Find the library libSDL2.a
FIND_LIBRARY(SDL2_LIBRARY SDL2 HINTS $ENV{SDL2} PATH_SUFFIXES lib)
# Find the library libSDL2main.a
FIND_LIBRARY(SDL2MAIN_LIBRARY SDL2main HINTS $ENV{SDL2} PATH_SUFFIXES lib)
INCLUDE(FindPackageHandleStandardArgs)
{
"caret_style": "phase",
"fade_fold_buttons": false,
"font_face": "Consolas",
"font_size": 9,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
#include <memory>
#include <vector>
using namespace std;
class Test {
public:
// vector of unique pointers to int
vector<unique_ptr<int>> intVector;
// moves a unique pointer into the vector
class Point {
private final int x, y;
private final String name; // Cached at construction time
Point(int x, int y) {
this.x = x;
this.y = y;
name = makeName();
@alexpana
alexpana / hacks.md
Last active September 17, 2024 06:47
C++ is a hack

Various 'features' of C++ that show the hacky / inconsistent way in which the language was constructed. This is a work in progress, and currently contains some of the reasons I can remember why I've given up on C++. If you want to contribute, leave your favourite "hack" in the comments.

  1. (in)Visibility: C++ allows changing the access modifier of a virtual function in the derived class. Not only does C++ have no notion of interfaces, it actually allows subclasses to hide methods declared public in the superclass.

  2. Operator over-overloading: One of the increment operators takes a dummy int parameter in order to allow overloading. Can you tell which without googling? (hint: its postfix).

  3. Exception unspecifiers: C++ has two types of exception specifiers: throw() and nothrow. The first is deprecated (because 'we screwed up, sorry, let's forget about this terrible mess'). The second one guarantees it's contract by terminating the application when violated. That's because functions declared