This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Test{ | |
private: | |
~Test(){ | |
cout<<"destroying..."<<endl; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#=========================# | |
#====With GCC compiler====# | |
#=========================# | |
#include <iostream> | |
using namespace std; | |
void reveal()__attribute__((constructor)); | |
void reveal(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <signal.h> | |
#include <cstdio> | |
#include <cstdlib> | |
using namespace std; | |
void sigintHandler(int sig_num){ | |
signal(SIGINT, sigintHandler); | |
printf("\n Connot be terminated, haha\n"); | |
fflush(stdout); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
typedef void (*fptr)(char* pString, int* pLen); | |
void istringlength(char* pString, int* pLen); | |
void pstringlength(char* pString, int* pLen); | |
fptr pFunc[2] = {istringlength, pstringlength}; | |
void istringlength(char* pString, int* pLen) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://net.tutsplus.com/tutorials/ruby/gem-creation-with-bundler/ | |
http://guides.rubygems.org/make-your-own-gem/ | |
http://net.tutsplus.com/tutorials/building-ribbit-in-scala/ | |
http://www.instructables.com/id/How-to-Make-an-Auto-Hacking-USB-Drive/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i to n | |
min = i | |
for j=i+1 to n | |
if( A[min] > A[j]) | |
min = j | |
end | |
end | |
swap(A[min], A[j]) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Class Form1 | |
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles tbxIn.TextChanged | |
End Sub | |
Private Sub btnTr_Click(sender As Object, e As EventArgs) Handles btnTr.Click | |
Dim textInput As String = tbxIn.Text | |
Dim len As Integer = textInput.Length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Cruel Games | |
Public Class Form1 | |
Private Sub btnStart_Click(sender As Object, e As EventArgs) Handles btnStart.Click | |
If (rbnLess.Checked) Then | |
MsgBox("sorry, you are too young, GTFO please") | |
ElseIf (rbnBetween.Checked) Then | |
MsgBox("Let's party rock") | |
Else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'even & odd | |
Public Class Form1 | |
Private Sub TextBox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox1.KeyPress | |
If e.KeyChar >= ChrW(Keys.D0) And e.KeyChar <= ChrW(Keys.D9) Then | |
e.Handled = False | |
Else | |
e.Handled = True | |
End If | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Class Form1 | |
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click | |
Dim amount As Double = nudAmount.Value | |
Dim rate As Double = nudRate.Value | |
Dim year As Double = nudYear.Value | |
Dim result As Double = amount * (1 + rate / 100) |