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 static String windows1251_to_utf8(String str_1251) throws Exception{ | |
String str_utf8 = ""; | |
for(int i=0;i<str_1251.length();i++){ | |
int c = Character.codePointAt(str_1251,i); | |
switch (c){ | |
case 184: c=1105;break; //eo | |
case 168: c=1025;break; // capital EO | |
case 175: c=1198; break; //capital UE | |
case 191: c=1199; break; //ue |
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 static class ControlExtentions | |
{ | |
public static void InvokeIfNeeded(this Control control, Action doit) | |
{ | |
if (control.InvokeRequired) | |
control.Invoke(doit); | |
else | |
doit(); | |
} | |
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://www.utf8-chartable.de/unicode-utf8-table.pl?start=1024&utf8=-&unicodeinhtml=dec | |
Public Sub RunEngToMon() | |
Dim msg As Outlook.MailItem | |
Dim insp As Outlook.Inspector | |
Dim strTemp As String | |
If Application.ActiveInspector Is Nothing Then | |
If Application.ActiveExplorer.Selection.Count = 1 Then | |
If Application.ActiveExplorer.Selection.Item(1).Class = olMail Then | |
Set msg = Application.ActiveExplorer.Selection.Item(1) |
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
#!/bin/bash | |
usage='usage: | |
./get_youtube_playlist <playlist_id> <target_folder> <num_songs> | |
target_folder: (default: songs will be downloaded in current folder) | |
num_songs: number of songs to get (default: 50) | |
examples: | |
./get_youtube_playlist RD02HIkZaLeuF9k | |
./get_youtube_playlist RD02HIkZaLeuF9k "my jazz" 10 |
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
/************************************************************************* | |
* | |
* This code generates a magic square for odd or even number. | |
* Based on methods : | |
* http://www.1728.org/magicsq1.htm - odd | |
* http://www.1728.org/magicsq2.htm - doublyEven | |
* http://www.1728.org/magicsq3.htm - singlyEven | |
* code by : uugan | |
* date : 01.06.2013 | |
* Compilation: javac MagicSquare.java |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Drawing; | |
using System.Drawing.Imaging; | |
using System.IO; | |
namespace GVF { | |
class gvf_field { | |
const double pi = 3.14159; |
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
/* Histogram hyperbolic equalization */ | |
float hyperbolic_histogram(unsigned char* inbuf, unsigned char* outbuf, int height,int width){ | |
double g_min=255; | |
double g_max=0; | |
double* histogram = new double[256]; | |
double* cdf = new double[256]; /* generates Pf(f) */ | |
double* out = new double[height*width]; /* output array of doubles */ | |
int start = GetTickCount(); | |
for(int i=0;i<256;i++) { |
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
/* Histogram exponential equalization when alpha = 0.011 */ | |
float exponential_histogram(unsigned char* inbuf, unsigned char* outbuf, int height, int width){ | |
double g_min=255; | |
double g_max=0; | |
double* histogram = new double[256]; | |
/* histogram array */ | |
double* cdf = new double[256]; /*Pf(f) values [cumulative distribution function]*/ | |
double* out = new double[height*width]; | |
int start = GetTickCount(); | |
for(int i=0;i<256;i++) |
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
/* Histogram 2/3 degrees */ | |
float hyperbolic_cube_root(unsigned char* inbuf, unsigned char* outbuf, int height, int width){ | |
int g_min=255; | |
int g_max=0; | |
double* histogram = new double[256]; /* histogram array 0..255*/ | |
double* cdf = new double[256]; /*Pf(f) cumulative distrib function */ | |
double* out = new double[height*width]; | |
int start = GetTickCount(); | |
for(int i=0;i<256;i++) { |
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
/* Smoothing image by K nearest neighbors */ | |
float SmoothbyKNN(unsigned char *inbuf, unsigned char* outbuf, int height, int width){ | |
int start = GetTickCount(); | |
int _k = 6; // _k<n*n | |
int _n = 3; // 3x3 | |
int p = 1; // 3/2 | |
int raz[9]; | |
int tmp=0, cnt=0, sum=0; | |
double* out = new double[height*width]; | |
for(int i=p;i<height-p;i++) |
NewerOlder