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 int calculateInSampleSize (BitmapFactory.Options options, int reqWidth, int reqHeight) { | |
// Raw height and width of image | |
final int height = options.outHeight; | |
final int width = options.outWidth; | |
int inSampleSize = 1; | |
if (height > reqHeight || width > reqWidth) { | |
final int halfHeight = height / 2; | |
final int halfWidth = width / 2; |
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
function NormalizeGradient (Gradient : TGradient; Norm : Integer) : TGradient; | |
var | |
i, j : Integer; | |
Step : Integer; | |
begin | |
Result := TGradient.Create (Norm); | |
Step := Gradient.Size/Norm; | |
i := 0; |
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
function AverageGradientPoint (Gradient : TGradient; Point, Radius : Integer) : RGB; | |
var | |
i : Integer; | |
RGBSum : array[0..2] of Integer; | |
const | |
R = 0; G = 1; B = 2; | |
begin |
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
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?autoload=true&lang=css" defer="defer"></script> | |
<script> | |
function resize() { | |
$(".prettyprint").css("width", 700); | |
$(".prettyprint").each(function() { | |
var parent = $(this).closest(".posttdMessage"); | |
$(this).css("width", $(parent).width()-24); // 24 - 2*12 padding | |
}); | |
$(".posttdMessage img").css("max-width", 700); |
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
<style> | |
.prettyprint { | |
width: 700px; | |
max-height: 500px; | |
overflow-x: auto; | |
overflow-y: auto; | |
font-size: 12px; | |
padding-left: 12px !important; | |
padding-right: 12px !important; | |
white-space: nowrap !important; |
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
@staticmethod | |
def generate_interested (i_user, task): | |
title = i_user.first_name+" "+i_user.last_name | |
body = "Заинтересовался заданием №"+str(task.id)+": \""+task.title+"\"" | |
notification = Notification.objects.create (to_users = True, task = task, | |
user = i_user, title = title, body = body, status = 3, system = False) | |
notification.to.add (task.user) | |
#notification.to.add (i_user) |
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
tinymce.init({ | |
selector: '.tinymce-widget', | |
//plugins : 'advlist autolink link image lists charmap print preview' | |
plugins: [ | |
'advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker', | |
'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media imagetools nonbreaking', | |
'save table contextmenu directionality emoticons template paste textcolor', | |
], | |
height: 400, | |
file_picker_types: 'file image media', |
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 <fstream> | |
#include <vector> | |
#include <string> | |
#include <array> | |
#include <math.h> | |
// Палитры цветов | |
#include "palettes.h" |
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 <fstream> | |
#include <vector> | |
#include <string> | |
#include <array> | |
#include <math.h> | |
// Палитры цветов | |
#include "palettes.h" |
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
#pragma once | |
uint8_t RGB4_Palette[][3] = { | |
{ 0 , 0 , 0 }, // Black | |
{ 255, 255, 255 }, // White | |
{ 255, 0 , 0 }, // Red | |
{ 0 , 255, 0 }, // Lime | |
{ 0 , 0 , 255 }, // Blue | |
{ 255, 255, 0 }, // Yellow | |
{ 0 , 255, 255 }, // Cyan / Aqua |
OlderNewer