This file contains hidden or 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
// Return an anaglyph image of a right and left channel | |
// Author : Nicolas Bourré 20100927 | |
IplImage * toAnaglyph(IplImage * imgLeft, IplImage *imgRight) | |
{ | |
IplImage *iplReturn; | |
IplImage *l_R, * l_G, *l_B; | |
IplImage *r_R, * r_G, *r_B; | |
iplReturn = cvCreateImage( cvGetSize (imgLeft), 8, 3); |
This file contains hidden or 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 <windows.h> // WinApi header | |
using namespace std; // std::cout, std::cin | |
int main() | |
{ | |
HANDLE hConsole; | |
int k; |
This file contains hidden or 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> | |
#include <stdlib.h> | |
#include <math.h> | |
float atan2_approximation1(float y, float x); | |
float atan2_approximation2(float y, float x); | |
int main() | |
{ | |
float x = 1; |
This file contains hidden or 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 <opencv2/opencv.hpp> | |
#include <iostream> | |
#include <vector> | |
#include <cmath> | |
using namespace cv; | |
using namespace std; | |
int main(int argc, char** argv) | |
{ |
This file contains hidden or 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
1- 32-bit data tiplerini kullanın. (Neden çünkü mimari bunun üzerine. | |
Bütün aritmatik işlem birimleri 32 bit için design edilmiş. Daha büyük veri tipleri bölünüp yapılır. | |
Küçük olanlarda 32 bitlik registerlara taşınır işaretli ise işaret genişletilir ekstra işlemler...) | |
2- Integer işlemlerinin işaretine önceden karar verin. Bölüm ve kalan hesaplarken, döngü sayaçları, | |
array indexleri için unsigned tipler, Integer-to-float dönüşümleri için signed tipler kullanın. | |
Kötü örnek: | |
double x; // MOV [tmep+4],0 | |
unsigned int i; // MOV EAX, i |
This file contains hidden or 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 <cv.h> | |
#include <cxcore.h> | |
#include <ml.h> | |
using namespace std; | |
int main() | |
{ | |
CvSVM SVM; |
This file contains hidden or 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
//f(bd) = |20 * bir_sayisi(bd) - 100| fonksiyonunu max yapan | |
// 30 karakterlik binary dizisinin(bd) hill climbing algoritmasi ile | |
//bulunmasi. | |
//Volkan SALMA. http://volkansalma.blogspot.com | |
#include <iostream> | |
#include <vector> | |
#include <stdlib.h> //for rand funct. | |
#include <time.h> //time for rand function seed. | |
#include <math.h> // for abs function |
This file contains hidden or 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
0 My Solution: SGGYVNFHLND@HEL@RFOYMGEO (143) Temp:99.6667 | |
1 My Solution: SGGYHNFHLND@HEL@RFOYMGEO (129) Temp:99.3333 | |
2 My Solution: SGGYHNFHLND@HEL@RFOYAGEO (117) Temp:99 | |
3 My Solution: SGGYHNRHLND@HEL@RFOYAGEO (105) Temp:98.6667 | |
4 My Solution: SGGLHNRHLND@HEL@RFOYAGEO (92) Temp:98.3333 | |
5 My Solution: SGGLHNRHLND@HEL@RFOYAGRO (85) Temp:98 | |
6 My Solution: SGGLHNRHLND@HEL@RMOYAGRO (78) Temp:97.6667 | |
7 My Solution: SGGLHNRHLND@HML@RMOYAGRO (72) Temp:97.3333 | |
8 My Solution: SNGLHNRHLND@HML@RMOYAGRO (65) Temp:97 | |
9 My Solution: SNGLBNRHLND@HML@RMOYAGRO (59) Temp:96.6667 |
This file contains hidden or 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
//Simulated Annealing C++ Sample Code | |
//generates "VOLKANSALMA@BLOGSPOT@COM" string. | |
//inspired from http://www.generation5.org/content/2003/gahelloworld.asp | |
//by volkan salma | |
//http://volkansalma.blogspot.com | |
#include <iostream> // for cout etc. | |
#include <vector> // for vector class | |
#include <string> // for string class | |
#include <algorithm> // for sort algorithm |
This file contains hidden or 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
#pragma warning(disable:4786) // disable debug warning | |
#include <iostream> // for cout etc. | |
#include <vector> // for vector class | |
#include <string> // for string class | |
#include <algorithm> // for sort algorithm | |
#include <time.h> // for random seed | |
#include <math.h> // for abs() | |
#define GA_POPSIZE 2048 // ga population size |
NewerOlder