Maksim, developer of ClickHouse.
1. Vectorized query execution
2. Runtime code generation
ClickHouse uses both
EXPLAIN PIPELINE SELECT a + b + c FROM test_table
┌─explain───────────────────┐
│ (Expression) │
│ ExpressionTransform │
│ (SettingQuotaAndLimits) │
│ (ReadFromStorage) │
│ TinyLog 0 → 1 │
└───────────────────────────┘
Expressions are represented in DAG that has input, function, constant nodes.
SELECT a + b + c FROM test_table;
1. Improve L1, L2 cache usages.
2. Less code to execute. Better usage of CPU branch predictor.
3. Eliminate indirections.
4. Multiple operations are fused in one function. More optimizations can be performed by compiler.
5. Using target CPU intructions.
Latency Comparison Numbers ---------------------------------- L1 cache reference 0.5 ns Branch mispredict 5 ns L2 cache reference 7 ns 14x L1 cache Mutex lock/unlock 25 ns Main memory reference 100 ns 20x L2 cache, 200x L1 cache Compress 1K bytes with Zippy 3,000 ns 3 us Send 1K bytes over 1 Gbps network 10,000 ns 10 us Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD Read 1 MB sequentially from memory 250,000 ns 250 us Round trip within same datacenter 500,000 ns 500 us
JIT standard expression compilation time is around 15ms. Grows linearly with code size.
Typical compiled expression code take around 600 bytes.
SELECT a + b + c FROM test_table;
SET compile_expressions = 1;
SELECT a + b + c FROM test_table;
compile_expressions is true by default from ClickHouse 21.6
min_count_to_compile_expression by default is 3
compiled_expression_cache_size by default is 1 GB
1. Binary operators. Example plus, minus, multiply, xor.
2. Unary operators. Example abs.
3. Logical functions. Example and, or, not.
4. Branch functions. Example if, multiIf.
5. Bit shift functions. Example bitShiftLeft
SELECT count() FROM hits
WHERE
((EventDate >= '2018-08-01')
AND (EventDate <= '2018-08-03')
AND (CounterID >= 34))
OR ((EventDate >= '2018-08-04')
AND (EventDate <= '2018-08-05')
AND (CounterID <= 101500))
— 649 533 033 rows per second.
SET compile_expressions = 1;
SELECT count() FROM hits
WHERE
((EventDate >= '2018-08-01')
AND (EventDate <= '2018-08-03')
AND (CounterID >= 34))
OR ((EventDate >= '2018-08-04')
AND (EventDate <= '2018-08-05')
AND (CounterID <= 101500))
— 865 491 052 rows per second.
— +33% performance improvement!
SELECT
number * 2 +
number * 3 +
number * 4 +
number * 5
FROM system.numbers
FORMAT Null
— 0 rows in set. Elapsed: 0.903 sec. Processed 329.23 million rows, 2.63 GB (364.78 million rows/s., 2.92 GB/s.
SET compile_expressions = 1;
SELECT
number * 2 +
number * 3 +
number * 4 +
number * 5
FROM system.numbers
FORMAT Null
— 0 rows in set. Elapsed: 1.602 sec. Processed 1.89 billion rows, 15.15 GB (1.18 billion rows/s., 9.46 GB/s.)
—
+323% performance improvement!
SET compile_expressions = 1;
WITH number AS x, if(x = 1, 1, if(x = 2, 2,
if(x = 3, 3, if(x = 4, 4, if(x = 5, 5,
if(x = 6, 6, if(x = 7, 7, if(x = 8, 8,
if(x = 9, 9, if(x = 10, 10,
if(x = 11, 11, 12))))))))))) AS res
SELECT sum(res)
FROM numbers(10000000)
— 0 rows in set. Elapsed: 0.150 sec. Processed 10.02 million rows, 80.18 MB (66.95 million rows/s., 535.56 MB/s.).
SET compile_expressions = 1;
WITH number AS x, if(x = 1, 1, if(x = 2, 2,
if(x = 3, 3, if(x = 4, 4, if(x = 5, 5,
if(x = 6, 6, if(x = 7, 7, if(x = 8, 8,
if(x = 9, 9, if(x = 10, 10,
if(x = 11, 11, 12))))))))))) AS res
SELECT sum(res)
FROM numbers(10000000)
— 0 rows in set. Elapsed: 0.061 sec. Processed 10.02 million rows, 80.18 MB (163.20 million rows/s., 1.31 GB/s.)
—
+244% performance improvement!
EXPLAIN SELECT sum(UserID)
FROM default.hits_100m_obfuscated GROUP BY WatchID
┌─explain──────────────────────────────────────┐
│ Expression ((Projection + Before ORDER BY)) │
│ Aggregating │
│ Expression (Before GROUP BY) │
│ SettingQuotaAndLimits │
│ ReadFromMergeTree │
└──────────────────────────────────────────────┘
1. Initializaze aggregate data for each function.
2. Fill aggregate data for each function.
3. Merge aggregate data for each function.
4. Insert result into final columns for each function.
1. Nullable wrapper.
2. Aggregation combinators -If, -Array.
Both contain are wrappers around other aggregate function. A lot of indirections.
SELECT
sum(UserID),
sum(ClientIP),
sum(CounterClass),
sum(CounterID),
sum(WatchID)
FROM default.hits_100m_obfuscated
GROUP BY WatchID
— 0 rows in set. Elapsed: 5.504 sec. Processed 100.00 million rows, 2.50 GB (18.17 million rows/s., 454.21 MB/s.)
SET compile_aggregate_expression = 1;
SELECT
sum(UserID),
sum(ClientIP),
sum(CounterClass),
sum(CounterID),
sum(WatchID)
FROM default.hits_100m_obfuscated
GROUP BY WatchID
— 0 rows in set. Elapsed: 4.146 sec. Processed 100.00 million rows, 2.50 GB (24.12 million rows/s., 603.06 MB/s.)
— +34% performance improvement!
SET compile_aggregate_expression = 1;
WITH (WatchID % 2 == 0) AS predicate
SELECT
minIf(UserID, predicate),
minIf(ClientIP, predicate),
minIf(CounterClass, predicate),
minIf(CounterID, predicate),
minIf(WatchID, predicate)
FROM default.hits_100m_obfuscated
GROUP BY WatchID
— 0 rows in set. Elapsed: 6.234 sec. Processed 100.00 million rows, 2.50 GB (16.04 million rows/s., 401.05 MB/s.)
SET compile_aggregate_expression = 1;
WITH (WatchID % 2 == 0) AS predicate
SELECT
minIf(UserID, predicate),
minIf(ClientIP, predicate),
minIf(CounterClass, predicate),
minIf(CounterID, predicate),
minIf(WatchID, predicate)
FROM default.hits_100m_obfuscated
GROUP BY WatchID
— 0 rows in set. Elapsed: 4.146 sec. Processed 100.00 million rows, 2.50 GB (24.12 million rows/s., 603.06 MB/s.)
— +71% performance improvement!
compile_aggregate_expressions
min_count_to_compile_aggregate_expression by default is 3
compiled_expression_cache_size by default is 1 GB. Same cache with compiled expressions from ExpressionStep.
1. Most common aggregate functions sum, count, min, max, avg, avgWeighted
2. Combinators -If
3. Null aggregation function adaptor.
JIT compilation improves performance of expression execution step in 1.5-3 times (for some cases more than 20 times), and aggregation step in 1.15-2 times
For expression step is available from release 21.6.
For aggregation step will be available from release 21.8 or 21.9.


↞ Index
|
← Prev
|
Next →
Test 017
Error if no element found.
engine for language 'en-us' loaded, but no elements found.
engine for language 'en-us' loaded, but no elements found.
Test
Ref


--- layout: page title: About header-img: "img/personal_pic.png" ---
I'm Efrain, an NYU Comp Sci alumnus who worked, unhappily, in customer service for years, until I decided it was time to recapture my desire to code for a living.


Deal
Preset Game{{preset?.name}}Game NameMin # of PlayersMax # of PlayersDeck Type{{deck?.name}}Number of Cards to PlayersDeck Location After DealTurn Up Card After DealHas Tricks
Users can move cards:
From {{userCommand?.fromDescription()}} to {{userCommand?.toDescription()}}{{desc}}


--- layout: post date: 2010-06-18 time: "09:00:00" authors: ["Greg Wilson"] title: First Half of Spreadsheets Lecture Now Online tags: ["Content"] ---
The first four episodes of Jason Montojo's lecture on spreadsheets are now online: topics covered include basic calculations, aggregation, controlling the display, sorting, and debugging. Please have a look and let us know what you think.


The Erase Mail File dialog box allows you to delete a file that is held in your Mail directory on CIX Forums.
You can choose the file to delete by clicking the Filename button or by entering the name in the Erase File text box. The list of files in you mail directory will only be as up-to-date as the last time you retrieved in from CIX Forums. If the file you were expecting to find is not in the list or if the Filename button is not visible click the Update button on the Mail Directory dialog.
Once you click OK an item will be added to the Out Basket and the file will be deleted the next time that Ameol connects to CIX Forums. You should be aware that once this file has been deleted it cannot be recovered. If you have sent the file to another user then deleting it from your mail directory does not delete it from their mail directory.


| [Runed Copper Gauntlets]
| 40
|
- 8 [Copper Bar]
- 2 [Rough Grinding Stone]
| Learned from any blacksmithing trainer.
|
| [Copper Chain Belt]
| 35
|
| Learned from any blacksmithing trainer.
|
| [Copper Battle Axe]
| 35
|
- 12 [Copper Bar]
- 2 [Light Leather]
- 2 [Malachite]
- 2 [Rough Grinding Stone]
- 2 [Weak Flux]
| Learned from any blacksmithing trainer.
|
| [Copper Claymore]
| 30
|
- 10 [Copper Bar]
- 1 [Light Leather]
- 1 [Rough Grinding Stone]
- 2 [Weak Flux]
| Learned from any blacksmithing trainer.
|
| [Copper Dagger]
| 30
|
- 6 [Copper Bar]
- 1 [Light Leather]
- 1 [Rough Grinding Stone]
- 1 [Weak Flux]
| Learned from any blacksmithing trainer.
|
| [Copper Shortsword]
| 25
|
- 6 [Copper Bar]
- 2 [Linen Cloth]
- 1 [Weak Flux]
| Learned from any blacksmithing trainer.
|
| [Rough Grinding Stone]
| 25
|
| Learned from any blacksmithing trainer.
|
| [Copper Axe]
| 20
|
- 6 [Copper Bar]
- 2 [Linen Cloth]
- 1 [Weak Flux]
| Learned from any blacksmithing trainer.
|
| [Copper Plate Boots]
| 20
|
| Learned from any blacksmithing trainer.
|
| [Copper Mace]
| 15
|
- 6 [Copper Bar]
- 2 [Linen Cloth]
- 1 [Weak Flux]
| Learned from any blacksmithing trainer.
|
| [Copper Bracers]
| 1
|
| Automatically learned when you learn the blacksmithing profession.
|
| [Copper Chain Pants]
| 1
|
| Learned from any blacksmithing trainer.
|
| [Rough Copper Vest]
| 1
|
| Automatically learned when you learn the blacksmithing profession.
|
| [Rough Sharpening Stone]
| 1
|
| Automatically learned when you learn the blacksmithing profession.
|
| [Rough Weightstone]
| 1
|
- 1 [Linen Cloth]
- 1 [Rough Stone]
| Automatically learned when you learn the blacksmithing profession.
|


Data Types | |
| type | string |
Public Member Functions | |
| subroutine | initdefault (this) |
| Constructor. More... | |
| subroutine, public | fstring_split (str, tokens, delimiters) |
| logical function, public | fstring_tological (str) |
| integer function, public | fstring_tointeger (str) |
| real(8) function, public | fstring_toreal (str) |
| type(string) function, public | fstring_tostring (str) |
| subroutine, public | fstring_tointegerarray (str, output) |
| subroutine, public | fstring_torealarray (str, output) |
| character(1000) function, public | fstring_frominteger (val, format) |
| character(:) function, allocatable, public | fstring_fromreal (val, format) |
| character(:) function, allocatable, public | fstring_fromlogical (val, format) |
| character(1000) function, public | fstring_fromintegerarray (val, format) |
| character(:) function, allocatable, public | fstring_fromrealarray (val, format) |
| character(:) function, allocatable, public | fstring_removetabs (str) |
| Replace every occurrence of the character in this string for four blank spaces. More... | |
| character(:) function, allocatable, public | fstring_replace (str, before, after, wholeWords, wordSeparators) |
| character(:) function, allocatable, public | fstring_replacebyrealarr (str, varName, varValue, wholeWords, wordSeparators) |
| integer function, public | fstring_count (str, ref, matchPos, wholeWords, wordSeparators) |
| integer function, public | fstring_hashkey (str) |
| Taken from the java.lang.String hash function, it use 32 bits. More... | |
| logical function, public | fstring_isnumeric (str) |
| character(len(str)) function, public | fstring_toupper (str) |
| Returns an uppercase copy of the string. More... | |
| character(len(str)) function, public | fstring_tolower (str) |
| Returns a lowercase copy of the string. More... | |
| logical function, public | fstring_isnull (str) |
| Returns a lowercase copy of the string. More... | |
| logical function, public | string_tological (str) |
| integer function, public | string_tointeger (str) |
| real(8) function, public | string_toreal (str) |
| subroutine, public | string_split (str, tokens, delimiters) |
Public Attributes | |
| character(*), parameter, public | endl = achar(10) |
| character(*), parameter, public | fstring_null = "@@!!##%%NULL%%##!!@@" |
Private Member Functions | |
| subroutine | fromfstring (this, fstr) |
| Constructor, from fortran string. More... | |
| subroutine | copy (this, other) |
| Copy constructor. More... | |
| subroutine | destroy (this) |
| Destructor. More... | |
| character(len=200) function | str (this) |
| Convert to string. More... | |
| subroutine | show (this, unit) |
| Show. More... | |
| logical function | isempty (this) |
| integer function | length (this) |
| character function | at (this, pos) |
| type(string) function | add (this, other) |
| type(string) function | addfstr (this, other) |
| logical function | lt (this, other) |
| logical function | eq (this, other) |
| logical function | eqfstr (this, other) |
| logical function | neq (this, other) |
| logical function | neqfstr (this, other) |
| subroutine | split (this, tokens, delimiters) |
| logical function | tological (this) |
| integer function | tointeger (this) |
| real(8) function | toreal (this) |
| subroutine | removetabs (this) |
| Replace every occurrence of the character in this string for four blank spaces. More... | |
| integer function | hashkey (this) |
| logical function | isnumeric (this) |
| type(string) function | toupper (this) |
| Returns an uppercase copy of the string. More... | |
| type(string) function | tolower (this) |
| Returns a lowercase copy of the string. More... | |
| subroutine | replace (this, before, after, wholeWords, wordSeparators) |
| Replaces every occurrence of the string before with the string after. More... | |
| subroutine | replacebyrealarr (this, varName, varValue, wholeWords, wordSeparators) |
| subroutine | string_test () |
| Test method. More... | |
Definition at line 27 of file String.f90.
|
private |
Definition at line 338 of file String.f90.
|
private |
Definition at line 349 of file String.f90.
|
private |
Definition at line 323 of file String.f90.
|
private |
Copy constructor.
Definition at line 223 of file String.f90.
|
private |
Destructor.
Definition at line 234 of file String.f90.
|
private |
Definition at line 371 of file String.f90.
|
private |
Definition at line 382 of file String.f90.
|
private |
Constructor, from fortran string.
Definition at line 211 of file String.f90.
| integer function, public string_::fstring_count | ( | character(*), intent(in) | str, |
| character(*), intent(in) | ref, | ||
| integer, dimension(:), intent(out), optional, allocatable | matchPos, | ||
| logical, intent(in), optional | wholeWords, | ||
| character(*), intent(in), optional | wordSeparators | ||
| ) |
Definition at line 811 of file String.f90.
| character(1000) function, public string_::fstring_frominteger | ( | integer, intent(in) | val, |
| character(*), intent(in), optional | format | ||
| ) |
Definition at line 643 of file String.f90.
| character(1000) function, public string_::fstring_fromintegerarray | ( | integer, dimension(:), intent(in) | val, |
| character(*), intent(in), optional | format | ||
| ) |
Definition at line 700 of file String.f90.
| character(:) function, allocatable, public string_::fstring_fromlogical | ( | logical, intent(in) | val, |
| character(*), intent(in), optional | format | ||
| ) |
Definition at line 681 of file String.f90.
| character(:) function, allocatable, public string_::fstring_fromreal | ( | real(8), intent(in) | val, |
| character(*), intent(in), optional | format | ||
| ) |
Definition at line 662 of file String.f90.
| character(:) function, allocatable, public string_::fstring_fromrealarray | ( | real(8), dimension(:), intent(in) | val, |
| character(*), intent(in), optional | format | ||
| ) |
Definition at line 719 of file String.f90.
| integer function, public string_::fstring_hashkey | ( | character(*), intent(in) | str | ) |
Taken from the java.lang.String hash function, it use 32 bits.
Definition at line 960 of file String.f90.
| logical function, public string_::fstring_isnull | ( | character(*), intent(in) | str | ) |
Returns a lowercase copy of the string.
Definition at line 1035 of file String.f90.
| logical function, public string_::fstring_isnumeric | ( | character(*), intent(in) | str | ) |
Definition at line 975 of file String.f90.
| character(:) function, allocatable, public string_::fstring_removetabs | ( | character(*), intent(inout) | str | ) |
Replace every occurrence of the character in this string for four blank spaces.
Definition at line 741 of file String.f90.
| character(:) function, allocatable, public string_::fstring_replace | ( | character(*), intent(in) | str, |
| character(*), intent(in) | before, | ||
| character(*), intent(in) | after, | ||
| logical, intent(in), optional | wholeWords, | ||
| character(*), intent(in), optional | wordSeparators | ||
| ) |
Definition at line 751 of file String.f90.
| character(:) function, allocatable, public string_::fstring_replacebyrealarr | ( | character(*), intent(inout) | str, |
| character(*), dimension(:), intent(in) | varName, | ||
| real(8), dimension(:), intent(in) | varValue, | ||
| logical, intent(in), optional | wholeWords, | ||
| character(*), intent(in), optional | wordSeparators | ||
| ) |
Definition at line 787 of file String.f90.
| subroutine, public string_::fstring_split | ( | character(*), intent(in) | str, |
| character(*), dimension(:), intent(out), allocatable | tokens, | ||
| character(*), intent(in) | delimiters | ||
| ) |
Definition at line 426 of file String.f90.
| integer function, public string_::fstring_tointeger | ( | character(*), intent(in) | str | ) |
Definition at line 555 of file String.f90.
| subroutine, public string_::fstring_tointegerarray | ( | character(*), intent(in) | str, |
| integer, dimension(:), allocatable | output | ||
| ) |
Definition at line 585 of file String.f90.
| logical function, public string_::fstring_tological | ( | character(*), intent(in) | str | ) |
Definition at line 545 of file String.f90.
| character(len(str)) function, public string_::fstring_tolower | ( | character(*), intent(in) | str | ) |
Returns a lowercase copy of the string.
Definition at line 1016 of file String.f90.
| real(8) function, public string_::fstring_toreal | ( | character(*), intent(in) | str | ) |
Definition at line 565 of file String.f90.
| subroutine, public string_::fstring_torealarray | ( | character(*), intent(in) | str, |
| real(8), dimension(:), allocatable | output | ||
| ) |
Definition at line 610 of file String.f90.
| type(string) function, public string_::fstring_tostring | ( | character(*), intent(in) | str | ) |
Definition at line 575 of file String.f90.
| character(len(str)) function, public string_::fstring_toupper | ( | character(*), intent(in) | str | ) |
Returns an uppercase copy of the string.
Definition at line 995 of file String.f90.
|
private |
Definition at line 893 of file String.f90.
| subroutine string_::initdefault | ( | class(string) | this | ) |
Constructor.
Definition at line 201 of file String.f90.
|
private |
Definition at line 303 of file String.f90.
|
private |
Definition at line 903 of file String.f90.
|
private |
Definition at line 313 of file String.f90.
|
private |
Definition at line 360 of file String.f90.
|
private |
Definition at line 393 of file String.f90.
|
private |
Definition at line 404 of file String.f90.
|
private |
Replace every occurrence of the character in this string for four blank spaces.
Definition at line 536 of file String.f90.
|
private |
Replaces every occurrence of the string before with the string after.
Definition at line 933 of file String.f90.
|
private |
Definition at line 946 of file String.f90.
|
private |
Show.
Definition at line 272 of file String.f90.
|
private |
Definition at line 415 of file String.f90.
|
private |
Convert to string.
Definition at line 243 of file String.f90.
| subroutine, public string_::string_split | ( | class(string), intent(in) | str, |
| character(*), dimension(:), intent(out), allocatable | tokens, | ||
| character(*), intent(in) | delimiters | ||
| ) |
Definition at line 1075 of file String.f90.
|
private |
Test method.
Definition at line 1086 of file String.f90.
| integer function, public string_::string_tointeger | ( | type(string), intent(in) | str | ) |
Definition at line 1055 of file String.f90.
| logical function, public string_::string_tological | ( | type(string), intent(in) | str | ) |
Definition at line 1045 of file String.f90.
| real(8) function, public string_::string_toreal | ( | type(string), intent(in) | str | ) |
Definition at line 1065 of file String.f90.
|
private |
Definition at line 515 of file String.f90.
|
private |
Definition at line 505 of file String.f90.
Returns a lowercase copy of the string.
Definition at line 923 of file String.f90.
|
private |
Definition at line 525 of file String.f90.
Returns an uppercase copy of the string.
Definition at line 913 of file String.f90.
| character(*), parameter, public string_::endl = achar(10) |
Definition at line 31 of file String.f90.
| character(*), parameter, public string_::fstring_null = "@@!!##%%NULL%%##!!@@" |
Definition at line 32 of file String.f90.


--- layout: default title: MetaCrazie ---
Trying to get this site up and running, please bear with me.


public class LocalStorageHandler
extends java.lang.Object
| Constructor and Description |
|---|
LocalStorageHandler()
The constructor initializes Gson to convert objects to
saveable strings, as well as an ElasticSearchHandler
which is used to refresh the currently saved questions.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
deleteFile(Context context,
java.lang.String filename) |
void |
deleteQuestionThread(Context context,
QuestionThread qt,
java.lang.String filename)
Deletes a given QuestionThread from local storage
|
void |
deleteQuestionThread(Context context,
QuestionThread qt,
java.lang.String filename,
java.lang.String id_filename)
Deletes a given QuestionThread from local storage, as well as
its associated id
|
java.util.ArrayList<java.lang.String> |
getIds(Context context,
java.lang.String filename)
Gets a list of ids from local storage.
|
java.lang.String |
getText(Context context,
java.lang.String filename)
Gets a string from local storage.
|
ThreadList |
getThreadList(Context context,
java.lang.String filename)
This method loads a ThreadList object from local storage
|
java.lang.String |
getUsername(Context context) |
void |
refreshLocals(Context context)
This method retrieves all of the questions which are in local storage
from the server and saves them again to their files.
|
void |
saveQuestionThread(Context context,
QuestionThread qt,
java.lang.String filename)
Adds a QuestionThread to a ThreadList in local storage
|
void |
saveQuestionThread(Context context,
QuestionThread qt,
java.lang.String filename,
java.lang.String id_filename)
Adds a QuestionThread to a ThreadList in local storage, as well as its
associated id to a separate file.
|
void |
saveQuestionThreads(Context context,
java.util.ArrayList<QuestionThread> qts,
java.lang.String filename)
Makes a ThreadList from a list of QuestionThreads and saves it to local storage
|
void |
saveQuestionThreads(Context context,
java.util.ArrayList<QuestionThread> qts,
java.lang.String filename,
java.lang.String id_filename)
Makes a ThreadList from a list of QuestionThreads and saves it to local storage, as
well as saving all of their associated ids to a separate file
|
void |
saveText(Context context,
java.lang.String text,
java.lang.String filename)
Saves a string to local storage.
|
void |
saveUsername(Context context,
java.lang.String username) |
public LocalStorageHandler()
public ThreadList getThreadList(Context context, java.lang.String filename)
context
- The context from which the method is being calledfilename
- The file to get the ThreadList frompublic void deleteQuestionThread(Context context, QuestionThread qt, java.lang.String filename)
context
- The context from which the method is being calledqt
- The QuestionThread to be deletedfilename
- The file to delete the QuestionThread frompublic void deleteQuestionThread(Context context, QuestionThread qt, java.lang.String filename, java.lang.String id_filename)
context
- The context from which the method is being calledqt
- The QuestionThread to be deletedfilename
- The file to delete the QuestionThread fromid_filename
- The file to delete the id frompublic void saveQuestionThread(Context context, QuestionThread qt, java.lang.String filename)
context
- The context from which the method is being calledqt
- The QuestionThread to be savedfilename
- The file to save the QuestionThread topublic void saveQuestionThread(Context context, QuestionThread qt, java.lang.String filename, java.lang.String id_filename)
context
- The context from which the method is being calledqt
- The QuestionThread to be savedfilename
- The file to save the QuestionThread toid_filename
- The file to save the id topublic void saveQuestionThreads(Context context, java.util.ArrayList<QuestionThread> qts, java.lang.String filename)
context
- The context from which the method is being calledqts
- The list of QuestionThreads to be savedfilename
- The file to save the ThreadList topublic void saveQuestionThreads(Context context, java.util.ArrayList<QuestionThread> qts, java.lang.String filename, java.lang.String id_filename)
context
- The context from which the method is being calledqts
- The list of QuestionThreads to be savedfilename
- The file to save the ThreadList toid_filename
- The file to save the ids topublic java.util.ArrayList<java.lang.String> getIds(Context context, java.lang.String filename)
context
- The context from which the method is being calledfilename
- The file to get the ids frompublic java.lang.String getUsername(Context context)
public void saveUsername(Context context, java.lang.String username)
public void saveText(Context context, java.lang.String text, java.lang.String filename)
context
- The context from which the method is being calledtext
- Text to be savedfilename
- The file to save the text topublic java.lang.String getText(Context context, java.lang.String filename)
context
- The context from which the method is being calledfilename
- The file to get the text frompublic void refreshLocals(Context context)
context
- The context from which the method is being calledpublic boolean deleteFile(Context context, java.lang.String filename)


Course Registration
Logout
Register
About Us
FAQ
Log Out
Success does not consist in never making mistakes but in never making the same one a second time.


Chat Waiting for connection Drag file here to send to active connections. Your PeerJS ID is Connect to a peer: Close selected connections
Start peer2peer Private key with sufficient founds (testnet) Address you want to invite to peer2peer (testnet) Execute


Do you have a great idea, but it's difficult to explain? We simplify your difficulties. With the aid of our explainer video, your idea will become crystal clear to potential users, leaving them unable to resist!
Tutorial videos are an excellent way to win over and keep clients. Easy video instructions will make your product convenient to use, and allow clients to evaluate all its strengths.
Do you need money to implement your idea? A video presentation will demonstrate the uniqueness and potential of your idea to investors, and a good video will increase the success of your crowdfunding campaign.
Useful articles and interesting reviews — we can use any content to make a video[SM2] which you can use to attract clients and earn their trust, and to gain prestige.
Is it time to think about the awareness and popularity of your product? Marketing and viral videos will attract popular attention and increase sales.
Congratulatory videos and video reports of events will draw your project team together and make it more productive.
Eye-catching videos containing colourful characters and infographics provide information in an accessible and captivating form. They are very popular throughout the world and fantastic for explainer videos and video presentations.
Enthralling live action videos are particularly attractive to viewers. Despite being more difficult to produce, they generate greater trust, and produce a greater emotional impact, making them suitable for ads and explainer videos.
Grabbing a video from a computer screen is the simplest way to tell people how to use your product. Enhancing the video with voice-overs and colourful graphics will produce quality[SM4] tutorial and explainer videos.
We provide language support for your videos (voice-overs, subtitles), enabling you to enter the world market and reach out to vast numbers of users.
Do you want to make a video for your project with minimal expense? We can convert your slide presentation into an animated video. This is the simplest and cheapest means of creating the first video for your project.
Existing tools for video promotion yield great results in a short time. We choose the best promotion strategy according to your aims and resources.
Information must be supplied intelligibly and interestingly, especially texts for websites and presentations. We write texts of any complexity according to your needs.
We also provide translation services into foreign languages. All our translation work is carried out and edited by native speakers, so you need not be concerned for your reputation on the world market.
Professional photographs of your prototype or team will create a more vivid picture of your project, and will greatly enhance your website or presentation.
and we will prepare a quotation based on your goals and resources.
No matter what your budget, we will provide the best solution.
Fill in a brief and send it to us by email:
<EMAIL_ADDRESS>.
Download brief


One language to rule them all
BABEL REPL https://babeljs.io/repl/ ↗
React vs Angular vs Vue
A declarative, efficient, and flexible JavaScript library for building user interfaces.- React team
React’s true strengths: composition, unidirectional data flow, freedom from DSLs, explicit mutation and static mental model.- Dan Abramov (Co-author of Redux and Create React App)
Life of a ComponentCredits: Mahesh Haldar https://hackernoon.com/reactjs-component-lifecycle-methods-a-deep-dive-38275d9d13c0
Life after React 16Credits: Dan Abramov https://twitter.com/dan_abramov/status/981712092611989509


---
title: Previous members of the lab
---
{% include head.html %}
{% include nav_nofront.html %}
{% for member in site.people_old %}
{{ member.name }}
{{ member.position }}
{% endfor %}
{% include rss_footer.html %}
{% include footer.html %}
{% include js.html %}


{% load static icon %} Already have an account? Sign In {% icon "life-buoy" class="me-2" height="16" width="16" %} Get support
Already have an account?


All npm packages contain a file, usually in the project root, called package.json - this file holds various metadata relevant to the project. This file is used to give information to npm that allows it to identify the project as well as handle the project's dependencies. It can also contain other metadata such as a project description, the version of the project in a particular distribution, license information, even configuration data - all of which can be vital to both npm and to the end users of the package. The package.json file is normally located at the root directory of a Node.js project.
{ "name" : "underscore", "description" : "JavaScript's functional programming helper library.", "homepage" : "http://documentcloud.github.com/underscore/", "keywords" : ["util", "functional", "server", "client", "browser"], "author" : "Jeremy Ashkenas", "contributors" : [], "dependencies" : [], "repository" : {"type": "git", "url": "git://github.com/documentcloud/underscore.git"}, "main" : "underscore.js", "version" : "1.1.6" }
When creating a new Node project, the first thing we need to do is create a package.json
file with an empty JSON object { }
inside. The dependencies field is used to list all the
dependencies of your project that are available on npm. When someone installs your project through npm,
all the dependencies listed will be installed as well. Additionally, if someone runs npm install
in the
root directory of your project, it will install all the dependencies to ./node_modules.
We can manually write the dependencies into our package.json file:
{ "dependencies": { "express": "^4.17.1", "nodemon": "^2.0.7" } }
Packages in npm follow Semantic Versioning, also known as “semver”.
When you install a new package it will be added to your package.json with a semver version range.
These versions are broken down into major.minor.patch
and looks like one of these:
3.14.1, 0.42.0, 2.7.18.
Each part of the version gets incremented at various times:
After we can run npm install
on the terminal which will install all the dependencies to ./node_modules,
or we can simply have a package.json file with an empty JSON object { }
inside and
use npm install <package_name>
in the terminal which will install the latest version of the package ./node_modules
and also write that dependency in the package.json file. Example:
npm install express
It is also possible to add a "devDependencies" field to your package.json - these are dependencies
not required for normal operation, but required/recommended if you want to patch or modify the project.
If you built your unit tests using a testing framework, for example,
it would be appropriate to put the testing framework you used in your devDependencies field.
To install a project's devDependencies, simply pass the --dev
option when you use npm install.
It's worth noting that the node_modules folder should always be an entry in the .gitignore file,
as it takes a tremendous amount of space. The dependencies can always be installed with the help ofpackage.json
and npm install
.
Node uses the core require module for managing module dependencies.
If we have a node_modules folder and an express.js module in there, the require('express')
command will find it and we can work with it.
For example take a look at how we can use the express module after installing it:
const express = require("express");
const app = express();
First we fetch the module and store it in a constant, and then we instantiate it and it's ready to be used for our http requests.


My official website
All the projects i have been working and the ones that are already finished.
My first developed website, built from a starting Template, made a lot of modifications, having implemented my own Carrousel and Canvas. Optimized for quick and light access, utilizing the following technologies.
Server-side code to store a list of my favorite movies, including box art imagery and a movie trailer URL. With python code to generate a static web page allowing visitors to browse throw my movies and watch trailers.
Developed code for interrupt overwork, that opens the web browser after selected amount of time
Developed code for renaming image file names, removing numbers so the words can be reordered alphabetically.
Developed code that checks for curse words in a text file.
Developed code working with the turtle python library, made for introductory self-learning at object-oriented python.
Developing code for learning NodeJS, covering the basic and advanced functionalities of the framework.
Developed code for learning how to make a payment system that accepts bitcoin, using NodeJS, Express and Mongoose.
Previously Experienced Embedded System Development Engineer with a demonstrated history of working in the information technology and services industry. Skilled in Python, C/C++, Contiki and embedded systems. Strong engineering professional graduated from Instituto Nacional de Telecomunicações - Inatel. Now aiming at the Fullstack skills


--- layout: page status: publish published: true title: Transit author: display_name: Jessie Pechmann login: jpechmann email<EMAIL_ADDRESS>url: '' author_login: jpechmann author_email<EMAIL_ADDRESS>wordpress_id: 3848 wordpress_url: http://gis.utah.gov/?page_id=3848 date: '2011-11-23 14:16:26 -0700' date_gmt: '2011-11-23 21:16:26 -0700' categories: [] tags: - sgid - Data - utah - gis - map - mapping - dataset - download - agrc - layer - shapefile - geodatabase - metadata - shp - gdb - kml - lyr - digital - geographic - information - database - state - statewide ---
Data Type: GIS Data Layer
Steward(s): Utah Transit Authority (UTA)
Abstract:
This dataset contains the UTA bus route and stop locations, commuter rail route and stop locations, and light rail route, and stop locations. The extent of these data is primarily along the Wasatch Front.
Data Content:
The following data is available for download:
Other links for this dataset:
Last Update: January 2017
Other links for this dataset:
Last Update: May, 2013
Other links for this dataset:
Last Update: May, 2013
The native spatial reference for this dataset is UTM Zone 12N, NAD83 (0.01 coordinate precision).
Questions can be directed to Lorraine Nelms<PHONE_NUMBER>) at UTA.[/tab]
Other links for this dataset:
Last Update: January 2017
The native spatial reference for this dataset is UTM Zone 12N, NAD83 (0.01 coordinate precision).
Questions can be directed to Lorraine Nelms<PHONE_NUMBER>) at UTA.[/tab]
Other links for this dataset:
Last Update: May 12, 2013


My bookshelf
Enter your book
Add this book
Reset all fields
Your Books:
Clear List
No Result ...
Save
X


Leaderboard
#
Name
ELO
Wins
Losses
Ratio
Biggest winning streak
Most consecutive losses
Biggest crush of the week
-
Valérian
won
11
7
11
9
11
4
Matchs-ups today
Incoming game
vs
Ranked #
Serving
Ranked #
Serving


{% extends "global/Page.html" %}
{% load staticfiles otree_tags %}
{% block title %}
{% endblock %}
{% block content %}
What do you think after chatting with the other player?
{% formfield player.is_it_still_knowledge with label=isitknowledgelabel %}
{% formfield player.still_confidence with label=still_confidence_label %}
{% formfield player.reason %}
{% formfield player.experience %}
{% next_button %}
{% endblock %}


For now, it is still tough to make hard promises on the pricing for camp. The prices below are estimates, based on a preliminary budget. By the time we are actually selling tickets, the final pricing will be knwon. Preregistrations, sponsoring and potential unknown costs may be factors that influence ticket prices.
In order to promote families in participating for camp, the pricing is currently estimated at:
| Ticket type | Ticket description | Ticket price | |
|---|---|---|---|
| Youngling | Less than 3 years old on 15 August 2014 | 23 € | 8 € |
| Initiate | Less than 6 years old on 15 August 2014 | 24 € | 16 € |
| Trainee | Less than 12 years old on 15 August 2014 | 25 € | 32 € |
| Apprentice | Less than 24 years old on 15 August 2014 | 26 € | 64 € |
| Knight | 24 years old or older on 15 August 2014 | 27 € | 128 € |
| Master | 8 bit business ticket with invoice | 28 € | 256 € |
It is important that ticket prices may still flux before tickets go on sale. We do not, however, expect prices to go up.


{% extends "layout_bsa.html" %} {% block page_title %} Social work bursary {% endblock %} {% block content %} Apply for Social Work Bursary When did the course start? Course details Start date Day Month Year {% endblock %}
Apply for Social Work Bursary


--- layout: default ---
Here are some of my projects. In time, more will be added.
{{ post.title | upcase | escape }}
{{ post.shortDescription }}


{% extends "layout-v2.html" %} {% block pageScripts %} {% endblock %} {% block pageTitle %} NHS Cervical screening management system {% endblock %} {% block header %} {% include '../components/header.html' %} {% endblock %} {% block content %}
Information about the external reports and how they work and how you get access to them
{{ actionLink({ "text": "View Tableau reports", "href": "https://www.nhs.uk/service-search/minor-injuries-unit/locationsearch/551" }) }}Information about the letters sent report
Total invites sent: 11602
Total results sent: 25074
Information about the lab files report


Step 1: Get-AppxPackage | gl name,packagefullname #identify full app name/version
Step 2: Modify necessary registry keys
Using your own binary:
If you are planning on running a “custom” executable, it must be able to handle the input the application sends in. If you set the debug application to notepad you can see what it sends into the application:
So, basically -P <number> and -tid <number> will be sent to the “debugger”.


| Constants |
| NONE |
This type means, that the results in the data fields are displayed like they are.
|
| ITEM_DIFFERENCE |
From each result, its reference value (see below) is subtracted, and the difference is shown.
Totals outside of the base field are shown as empty results.
|
| ITEM_PERCENTAGE |
Each result is divided by its reference value. The reference value is determined in the
same way as for DataPilotFieldReferenceType::ITEM_DIFFERENCE.
Totals outside of the base field are shown as empty results.
|
| ITEM_PERCENTAGE_DIFFERENCE |
From each result, its reference value is subtracted, and the difference divided by the
reference value. The reference value is determined in the same way as for
DataPilotFieldReferenceType::ITEM_DIFFERENCE.
Totals outside of the base field are shown as empty results.
|
| RUNNING_TOTAL |
Each result is added to the sum of the results for preceding items in the base field,
in the base field's sort order, and the total sum is shown.
|
| ROW_PERCENTAGE |
Each result is divided by the total result for its row in the DataPilot table.
|
| COLUMN_PERCENTAGE |
Same as DataPilotFieldReferenceType::ROW_PERCENTAGE, but the total for the result's column is used.
|
| TOTAL_PERCENTAGE |
Same as DataPilotFieldReferenceType::ROW_PERCENTAGE, but the grand total for the result's data field is used.
|
| INDEX |
The row and column totals and the grand total, following the same rules as above, are used to calculate the following expression.
|
| Constants' Details |
NONE
const long NONE = 0;
- Description
- This type means, that the results in the data fields are displayed like they are.
|
|
ITEM_DIFFERENCE
const long ITEM_DIFFERENCE = 1;
- Description
- From each result, its reference value (see below) is subtracted, and the difference is shown.
Totals outside of the base field are shown as empty results.
Named Item
If a base item name is specified, the reference value for a combination of field items is the
result where the item in the base field is replaced by the specified base item.
If the reference value isn't shown in the DataPilot table because of hidden details for a
parent field, the difference isn't calculated and an error value is shown.
If the result for an item combination is empty, the value 0 is used for the difference, even
if the summary function is undefined without values, like average or variance. The difference
is shown in the result table even if the original result was empty.
The difference for item combinations containing the base item is shown as empty result.
Previous or Next
If "previous" or "next" is specified as the base item, the reference value is the result for
the next visible member of the base field, in the base field's sort order. If details for one
item in the base field are hidden, that item is skipped. The difference for the item with
hidden details isn't calculated, not even for the item's summary, to have a consistent order
of previous and next items.
Empty results are handled as for named items (see above).
The difference for the first (for com::sun::star::sheet::DataPilotFieldReferenceItemType::PREVIOUS)
or last (for com::sun::star::sheet::DataPilotFieldReferenceItemType::NEXT) item of the base field is
shown as empty result.
|
|
ITEM_PERCENTAGE
const long ITEM_PERCENTAGE = 2;
- Description
- Each result is divided by its reference value. The reference value is determined in the
same way as for DataPilotFieldReferenceType::ITEM_DIFFERENCE.
Totals outside of the base field are shown as empty results.
Division by zero results in an error. Otherwise, empty results are shown as 0. Results for
the base item, first (for com::sun::star::sheet::DataPilotFieldReferenceItemType::PREVIOUS)
or last (for com::sun::star::sheet::DataPilotFieldReferenceItemType::NEXT) item of the base field are shown
as 1 if not empty.
|
|
ITEM_PERCENTAGE_DIFFERENCE
const long ITEM_PERCENTAGE_DIFFERENCE = 3;
- Description
- From each result, its reference value is subtracted, and the difference divided by the
reference value. The reference value is determined in the same way as for
DataPilotFieldReferenceType::ITEM_DIFFERENCE.
Totals outside of the base field are shown as empty results.
Division by zero results in an error. Otherwise, the rules for DataPilotFieldReferenceType::ITEM_DIFFERENCE apply.
|
|
RUNNING_TOTAL
const long RUNNING_TOTAL = 4;
- Description
- Each result is added to the sum of the results for preceding items in the base field,
in the base field's sort order, and the total sum is shown.
If details for one item in the base field are hidden, that item isn't included in
calculating the sum, and results for that item are shown as error, to ensure consistency
between details and subtotals for the following items.
Results are always summed, even if a different summary function was used to get each result.
Totals outside of the base field are shown as empty results.
|
|
ROW_PERCENTAGE
const long ROW_PERCENTAGE = 5;
- Description
- Each result is divided by the total result for its row in the DataPilot table.
If there are several data fields, the total for the result's data field is used.
If there are subtotals with manually selected summary functions, still the total with
the data field's summary function is used.
Division by zero results in an error.
Otherwise, empty results remain empty.
|
|
COLUMN_PERCENTAGE
const long COLUMN_PERCENTAGE = 6;
- Description
- Same as DataPilotFieldReferenceType::ROW_PERCENTAGE, but the total for the result's column is used.
|
|
TOTAL_PERCENTAGE
const long TOTAL_PERCENTAGE = 7;
- Description
- Same as DataPilotFieldReferenceType::ROW_PERCENTAGE, but the grand total for the result's data field is used.
|
|
INDEX
const long INDEX = 8;
- Description
- The row and column totals and the grand total, following the same rules as above, are used to calculate the following expression.
( original result * grand total ) / ( row total * column total )
Division by zero results in an error. Otherwise, empty results remain empty.
|
|
Copyright © 2013, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.


--- layout: post title: Episode 049 | Dave Thomas - Programmer First link: http://traffic.libsyn.com/developeronfire/DeveloperOnFire-49-DaveThomas.mp3 length: 51380224 speaker: Dave Rael duration: '54:22' subtitle: 'Developer On Fire: Dave Thomas' guest_name: Dave Thomas image: /assets/images/DaveThomas.jpg guest_blog: pragdave.me guest_twitter: pragdave disqus_url: http://developeronfire.com/Podcast/Episodes/dave-thomas-programmer-first episode_number: 49 redirect_from: - "/49/" - "/049/" - "/0049/" - "/dave-thomas-programmer-first/" - "/Dave-Thomas/" - "/DaveThomas/" - "/Podcast/Episodes/49/" - "/Podcast/Episodes/049/" - "/Podcast/Episodes/0049/" - "/Podcast/Episodes/dave-thomas-programmer-first/" - "/Podcast/Episodes/Dave-Thomas/" - "/Podcast/Episodes/DaveThomas/" guid: http://developeronfire.com:80/Podcast/Episodes/dave-thomas-programmer-first ---
Dave Thomas is recognized internationally as an expert who develops high-quality software–accurate and highly flexible systems. He helped write the now-famous Agile Manifesto, and regularly speaks on new ways of producing software. He is the author of many books, including the best selling The Pragmatic Programmer: From Journeyman to Master. He's probably responsible for bringing Ruby to attention of Western developers with the book Programming Ruby and was one of the first adopters of Rails. He's a programmer, trainer, author, speaker, and publisher.
1. Ask people
2. Become the customer first
3. Have courage


An extension of Keystone Bar & Grill, this fast-casual restaurant puts a twist on typical comfort food. The only other location is currently outside the University of Cincinnati's campus.
Maureen Murray, the marketing manager for Four Entertainment Group's Keystone division, which runs Keystone's Mac Shack, said the restaurant is known for its late-night hours.
The Cincinnati location is open from 11:30 a.m. to 10 p.m. on Sunday and Monday, 11:30 a.m. to midnight Tuesday through Thursday and until 2 a.m. on the weekend. Murray said closing hours for the Athens location may be around 4 a.m.
The restaurant is also known for its musically-inspired mac and cheese meals and unique combinations, Murray said.
"I think one of the things we've focused on recently is being super customizable," Murray said. "We have our mac and cheese on the menu but then people can mix and match their own and make whatever they want out of their mac and cheese."
Charlie Wilson, a sophomore studying mechanical engineering at the University of Cincinnati, said he would frequently eat at Keystone's Mac Shack during the school year.
"(My friends and I) definitely went out of our way to go to (Keystone's) a few times," Wilson said. "Me and my roommates found it (was) really good, and it's one of the closest actual restaurants, other than fast food places, you can go into."
Bennett Snyder, an Ohio University junior studying journalism, said he has also visited Keystone's Cincinnati location while visiting friends at UC. "The first time I had it, I knew I didn't want to eat any other late-night food ever if I visited them," Snyder said. "I felt like it was the perfect combination of heavy but not too heavy (as) a late night meal and it was really good."
Although Snyder said the most popular menu items were the Powerhouse and Buffalo Springfield mac and cheese, his favorite dish was the Cordon Lightfoot, which adds chicken, ham and Swiss cheese to a traditional macaroni meal.
Snyder said he was happy to see the grub spot expand into another college town and is excited to experience the specialized Athens location.
"I think it's really smart to open on another college campus," Snyder said. "I think their business model at UC is a really smart thing, being open super late. There's definitely some competition in Athens in the late-night food department but I think it'll do really well."
Murray explained that the late-night convenience concept works with younger people, and the decision to expand into Athens has been received positively by students and residents.
"I think [Keystone wants] to expand more into college towns," Murray said. "OU just has a really great footprint of nightlife… so it was a fun way to make the next step of expanding, but within an attainable distance and demographic."


I'm a tenacious developer with a background in biochemical research and a passion for solving tough problems.
I had my first introduction to software development through a Bioinformatics course I took while studying Biochemistry at Boston University. It was just a taste of Python, but I was immediately hooked. Since then, I’ve had a chance to build applications for biochemical research, ecommerce, and restaurant point of sale.
My experience in research instilled in me a relentless and detail-oriented approach to problem solving. In fact, some of my favorite moments in the development process come from hitting a wall. There’s a unique sense of satisfaction I get from pulling out a hammer and some nails to start building a ladder. I’m eager to bring my determination, and my passion for learning to a forward-thinking engineering team where I can help to drive growth through thoughtful, scalable solutions.
Golang, MongoDB, Angular.js, Node.js, PostgreSQL, AWS Serverless infrastructure
Worked as a full-stack developer on a web-based restaurant point of sale, and on the associated ETL pipelines, data warehouse, and reporting software. Highlights include:
Rebuilt a legacy Spark/Scala traditional ETL with a serverless Go-based real-time streaming ETL, reducing typical data latency by 80% and allowing for automated scaling under heavy load
Implemented a cross-platform payment processing integration for Restaurant POS, coordinating internal teams across Android, Web, and Server-based platforms along with 3rd-party teams at PAX and TSYS
Restructured the storage, transportation, and editing of labor data across three (formerly separate) internal platforms to allow for a shared “source of truth” and consolidated payroll processing for our customers
Ruby on Rails, PostgreSQL, Redis, RabbitMQ, AWS
Worked as a back-end software engineer on an e-commerce site where gamers can purchase coaching time from esports professionals. Highlights include:
Identified API endpoints causing significant memory consumption issues, then refactored and optimized the queries used in these endpoints, resulting in an 80% reduction in request/response time for the most affected users, and a 50% reduction in application memory usage during periods of typical load
Added integration of AmazonPay to the payment system, and built a refund system that integrates with Stripe and Paypal.
Redesigned the calendar availabilities and lesson scheduling system to allow for more granular control of what types of students a sensei accepts lessons from at any given time.
Ruby on Rails, Ruby-Grape, Cassandra, Apache Spark, Scala, PostgreSQL, RabbitMQ, GCP
Worked as a back-end software engineer and data engineer on a League of Legends meta analysis platform.
Built a Ruby-based system that spiders through the Riot Games League of Legends API to transform and store data from hundreds of millions of matches into a Cassandra database.
Built a system using GCP BigQuery and Apache Spark (Scala) which performs a series of transformations and aggregations on the large-scale match dataset and user data to generate and store a number of detailed meta analyses.
Built Rails/Ruby-Grape APIs to serve the aggregated and blended data to the leaguemeta.gg web platform, and to the senseibot discord chat bot.
Ruby-Grape, PostgreSQL, Steam API
Worked as a back-end software engineer on a 'shooting range' mastery game for first-person shooters, available on Steam. Projects included:
Built a user authentication system, and an API to recieve, validate, and store incoming match data from the game client.
Built a leaderboard and achievement system that integrates with the Steam developer API.
HTML, CSS3/SASS, Bootstrap, Handlebars, JavaScript, Stripe, Express, Mongoose, MongoDB
A full-stack e-commerce site where users can browse, search, sort, and purchase a variety of products across a range of categories. Payments are processed via the Stripe API. Users’ order history and cart contents are stored on the back end. This was a group project created alongside the wildly talented developers Andrew Young and Pedro Tavarez.
HTML, CSS3/SASS, Bootstrap, Handlebars, JavaScript, Ruby on Rails, PostgreSQL
A full-stack application featuring a turn-based, roguelike RPG. Users can fight through increasingly difficult waves of goblins, purchase weapons and character upgrades with gold they earn in battle, and compete for a place on the global leaderboards.
Ember.js, CSS3/SASS, JavaScript, Ruby on Rails, PostgreSQL, Twilio
An inventory/task management tool where users can organize ‘Items’ they care about (tangibles, to-dos, etc.) into shareable ‘Boxes’. Major features include access control lists for each Box, and SMS messaging via Twilio.
HTML/CSS3, JavaScript, Ruby on Rails, PostgreSQL
A single page application hub for different variants of Tic Tac Toe, including classic and numeric game modes. Each user’s games are saved to their account and can be reloaded to play again another time.


Creates a polka dot background pattern. - Use `background-color` to set a black background. - Use `background-image` with two `radial-gradient()` values to create two dots. - Use `background-size` to specify the pattern's size and `background-position` to appropriately place the two gradients. - **Note:** The fixed `height` and `width` of the element is for demonstration purposes only.


The safe deposit forms and equipment we offer are of the highest standard in the industry.
Our comprehensive line of safe deposit forms are designed to meet the issues of today's audit, compliance and regulatory demands. We invite you to review our forms. We also invite your legal counsel to review our safe deposit lease agreement and the regulatory areas of our other forms as well. Should your legal counsel request any changes to the regulatory areas of our forms, we will gladly make any changes for a small one-time typesetting fee. View our forms
Having trouble finding just the right form? We will be happy to help you design the form you desire?. Just send us a sketch or sample.
Whether it be vault ladders or key storage trays, we strive to provide the most durable and best quality safe deposit equipment at an affordable price. View our vault equipment
When considering the purchase of new safe deposit boxes, AdvanceTec is able to assist you in determining the particular needs for your location. We only sell safe deposit boxes MADE IN AMERICA. View our boxes
We are pleased to offer a comprehensive line of safe deposit policy and procedure manuals authored by the renowned safe deposit specialist David P. McGuinn, "the Guru." AdvanceTec has been associated with Mr McGuinn for many years. View our manuals
We are dedicated to providing you, our customers, with high quality products. We guarantee that the materials and workmanship used for each of our products will be of excellent quality and that they will serve to the satisfaction of our customers.
If you need to return an item, please contact our Customer Service Department at<PHONE_NUMBER> for assistance. All items must be returned in their original packaging, if applicable. Please note that any special order merchandise and those items which are printed to your specifications are exempt from this policy.


#include <stdarg.h>
Go to the source code of this file.
◆ SERIAL_COM1_BASE
| #define SERIAL_COM1_BASE 0x3F8 /* COM1 base port */ |
All the I/O ports are calculated relative to the data port. This is because all serial ports (COM1, COM2, COM3, COM4) have their ports in the same order, but they start at different values.
◆ SERIAL_DATA_PORT
◆ SERIAL_FIFO_COMMAND_PORT
| #define SERIAL_FIFO_COMMAND_PORT |
( |
|
base | ) |
(base + 2) |
◆ SERIAL_LINE_COMMAND_PORT
| #define SERIAL_LINE_COMMAND_PORT |
( |
|
base | ) |
(base + 3) |
◆ SERIAL_LINE_ENABLE_DLAB
| #define SERIAL_LINE_ENABLE_DLAB 0x80 |
◆ SERIAL_LINE_STATUS_PORT
| #define SERIAL_LINE_STATUS_PORT |
( |
|
base | ) |
(base + 5) |
◆ SERIAL_MODEM_COMMAND_PORT
| #define SERIAL_MODEM_COMMAND_PORT |
( |
|
base | ) |
(base + 4) |
◆ init_serial()
Initialize the serial port COM1.
◆ printfSerial()
| int printfSerial |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
◆ serialRead()
Read from the serial port COM1.
◆ serialWrite()
| void serialWrite |
( |
char |
c | ) |
|


{% extends "base.html" %} {% block title %}
Medieval catalogues > SECULAR INSTITUTIONS: Secular Colleges > Bosham > Inventory of church goods, 21 September 1371
{% endif %}1 identified entry found.
All data was derived from the List of Identifications by Professor Richard Sharpe.
{% if not printing %}
A key to codes used in the List is available (opens in new tab).{% endif %}


{% extends "layout.html" %} {% block body %} / Flight Delay Prediction with Kafka
Predicting Flight Delays with Kafka
Delay:


Images¶
pyglet provides functions for loading and saving images in various formats using native operating system services. pyglet can also work with the Python Imaging Library (PIL) for access to more file formats.
Loaded images can be efficiently provided to OpenGL as a texture, and OpenGL textures and framebuffers can be retrieved as pyglet images to be saved or otherwise manipulated.
pyglet also provides an efficient and comprehensive Sprite class, for displaying images on the screen with an optional transform.
Loading an image¶
Images can be loaded using the pyglet.image.load function:
kitten = pyglet.image.load('kitten.png')
If the image is distributed with your application, consider using the pyglet.resource module (see Application resources).
Without any additional arguments, load will attempt to load the filename specified using any available image decoder. This will allow you to load PNG, GIF, JPEG, BMP and DDS files, and possibly other files as well, depending on your operating system and additional installed modules (see the next section for details). If the image cannot be loaded, an ImageDecodeException will be raised.
You can load an image from any file-like object providing a read method by specifying the file keyword parameter:
kitten_stream = open('kitten.png', 'rb')
kitten = pyglet.image.load('kitten.png', file=kitten_stream)
In this case the filename kitten.png is optional, but gives a hint to the decoder as to the file type (it is otherwise unused).
pyglet provides the following image decoders:
Module Class Description pyglet.image.codecs.dds DDSImageDecoder Reads Microsoft DirectDraw Surface files containing compressed textures pyglet.image.codecs.gdiplus GDIPlusDecoder Uses Windows GDI+ services to decode images. pyglet.image.codecs.gdkpixbuf2 GdkPixbuf2ImageDecoder Uses the GTK-2.0 GDK functions to decode images. pyglet.image.codecs.pil PILImageDecoder Wrapper interface around PIL Image class. pyglet.image.codecs.png PNGImageDecoder PNG decoder written in pure Python. pyglet.image.codecs.quicktime QuickTimeImageDecoder Uses Mac OS X QuickTime to decode images.
Each of these classes registers itself with pyglet.image with the filename extensions it supports. The load function will try each image decoder with a matching file extension first, before attempting the other decoders. Only if every image decoder fails to load an image will ImageDecodeException be raised (the origin of the exception will be the first decoder that was attempted).
You can override this behaviour and specify a particular decoding instance to use. For example, in the following example the pure Python PNG decoder is always used rather than the operating system’s decoder:
from pyglet.image.codecs.png import PNGImageDecoder
kitten = pyglet.image.load('kitten.png', decoder=PNGImageDecoder())
This use is not recommended unless your application has to work around specific deficiences in an operating system decoder.
Supported image formats¶
The following table lists the image formats that can be loaded on each operating system. If PIL is installed, any additional formats it supports can also be read. See the Python Imaging Library Handbook for a list of such formats.
 Depth, volume and cube textures are not supported. |
Working with images¶
The pyglet.image.load function returns an AbstractImage. The actual class of the object depends on the decoder that was used, but all images support the following attributes:
- width
- The width of the image, in pixels.
- height
- The height of the image, in pixels.
- anchor_x
- Distance of the anchor point from the left edge of the image, in pixels
- anchor_y
- Distance of the anchor point from the bottom edge of the image, in pixels
The anchor point defaults to (0, 0), though some image formats may contain an intrinsic anchor point. The anchor point is used to align the image to a point in space when drawing it.
You may only want to use a portion of the complete image. You can use the get_region method to return an image of a rectangular region of a source image:
image_part = kitten.get_region(x=10, y=10, width=100, height=100)
This returns an image with dimensions 100x100. The region extracted from kitten is aligned such that the bottom-left corner of the rectangle is 10 pixels from the left and 10 pixels from the bottom of the image.
Image regions can be used as if they were complete images. Note that changes to an image region may or may not be reflected on the source image, and changes to the source image may or may not be reflected on any region images. You should not assume either behaviour.
The AbstractImage hierarchy¶
The following sections deal with the various concrete image classes. All images subclass AbstractImage, which provides the basic interface described in previous sections.
An image of any class can be converted into a Texture or ImageData using the get_texture and get_image_data methods defined on AbstractImage. For example, to load an image and work with it as an OpenGL texture:
kitten = pyglet.image.load('kitten.png').get_texture()
There is no penalty for accessing one of these methods if object is already of the requested class. The following table shows how concrete classes are converted into other classes:
Original class .get_texture() .get_image_data() Texture No change glGetTexImage2D TextureRegion No change glGetTexImage2D, crop resulting image. ImageData glTexImage2D [1] No change ImageDataRegion glTexImage2D [1] No change CompressedImageData glCompressedTexImage2D [2] N/A [3] BufferImage glCopyTexSubImage2D [4] glReadPixels
You should try to avoid conversions which use glGetTexImage2D or glReadPixels, as these can impose a substantial performance penalty by transferring data in the “wrong” direction of the video bus, especially on older hardware.
| [1] | (1, 2) ImageData caches the texture for future use, so there is no performance penalty for repeatedly blitting an ImageData. |
| [2] | If the required texture compression extension is not present, the image is decompressed in memory and then supplied to OpenGL via glTexImage2D. |
| [3] | It is not currently possible to retrieve ImageData for compressed texture images. This feature may be implemented in a future release of pyglet. One workaround is to create a texture from the compressed image, then read the image data from the texture; i.e., compressed_image.get_texture().get_image_data(). |
| [4] | BufferImageMask cannot be converted to Texture. |
Accessing or providing pixel data¶
The ImageData class represents an image as a string or sequence of pixel data, or as a ctypes pointer. Details such as the pitch and component layout are also stored in the class. You can access an ImageData object for any image with get_image_data:
kitten = pyglet.image.load('kitten.png').get_image_data()
The design of ImageData is to allow applications to access the detail in the format they prefer, rather than having to understand the many formats that each operating system and OpenGL make use of.
The pitch and format properties determine how the bytes are arranged. pitch gives the number of bytes between each consecutive row. The data is assumed to run from left-to-right, bottom-to-top, unless pitch is negative, in which case it runs from left-to-right, top-to-bottom. There is no need for rows to be tightly packed; larger pitch values are often used to align each row to machine word boundaries.
The format property gives the number and order of color components. It is a string of one or more of the letters corresponding to the components in the following table:
R Red G Green B Blue A Alpha L Luminance I Intensity
For example, a format string of "RGBA" corresponds to four bytes of colour data, in the order red, green, blue, alpha. Note that machine endianness has no impact on the interpretation of a format string.
The length of a format string always gives the number of bytes per pixel. So, the minimum absolute pitch for a given image is len(kitten.format) * kitten.width.
To retrieve pixel data in a particular format, use the get_data method, specifying the desired format and pitch. The following example reads tightly packed rows in RGB format (the alpha component, if any, will be discarded):
kitten = kitten.get_image_data()
data = kitten.get_data('RGB', kitten.width * 3)
data always returns a string, however it can be set to a ctypes array, stdlib array, list of byte data, string, or ctypes pointer. To set the image data use set_data, again specifying the format and pitch:
kitten.set_data('RGB', kitten.width * 3, data)
You can also create ImageData directly, by providing each of these attributes to the constructor. This is any easy way to load textures into OpenGL from other programs or libraries.
Performance concerns¶
pyglet can use several methods to transform pixel data from one format to another. It will always try to select the most efficient means. For example, when providing texture data to OpenGL, the following possibilities are examined in order:
- Can the data be provided directly using a built-in OpenGL pixel format such as GL_RGB or GL_RGBA?
- Is there an extension present that handles this pixel format?
- Can the data be transformed with a single regular expression?
- If none of the above are possible, the image will be split into separate scanlines and a regular expression replacement done on each; then the lines will be joined together again.
The following table shows which image formats can be used directly with steps 1 and 2 above, as long as the image rows are tightly packed (that is, the pitch is equal to the width times the number of components).
Format Required extensions "I" "L" "LA" "R" "G" "B" "A" "RGB" "RGBA" "ARGB" GL_EXT_bgra and GL_APPLE_packed_pixels "ABGR" GL_EXT_abgr "BGR" GL_EXT_bgra "BGRA" GL_EXT_bgra
If the image data is not in one of these formats, a regular expression will be constructed to pull it into one. If the rows are not tightly packed, or if the image is ordered from top-to-bottom, the rows will be split before the regular expression is applied. Each of these may incur a performance penalty – you should avoid such formats for real-time texture updates if possible.
Image sequences and atlases¶
Sometimes a single image is used to hold several images. For example, a “sprite sheet” is an image that contains each animation frame required for a character sprite animation.
pyglet provides convenience classes for extracting the individual images from such a composite image as if it were a simple Python sequence. Discrete images can also be packed into one or more larger textures with texture bins and atlases.
Image grids¶
An “image grid” is a single image which is divided into several smaller images by drawing an imaginary grid over it. The following image shows an image used for the explosion animation in the Astraea example.
This image has one row and eight columns. This is all the information you need to create an ImageGrid with:
explosion = pyglet.image.load('explosion.png')
explosion_seq = pyglet.image.ImageGrid(explosion, 1, 8)
The images within the grid can now be accessed as if they were their own images:
frame_1 = explosion_seq[0]
frame_2 = explosion_seq[1]
Images with more than one row can be accessed either as a single-dimensional sequence, or as a (row, column) tuple; as shown in the following diagram.
Image sequences can be sliced like any other sequence in Python. For example, the following obtains the first four frames in the animation:
start_frames = explosion_seq[:4]
For efficient rendering, you should use a TextureGrid. This uses a single texture for the grid, and each individual image returned from a slice will be a TextureRegion:
explosion_tex_seq = image.TextureGrid(explosion_seq)
Because TextureGrid is also a Texture, you can use it either as individual images or as the whole grid at once.
3D textures¶
TextureGrid is extremely efficient for drawing many sprites from a single texture. One problem you may encounter, however, is bleeding between adjacent images.
When OpenGL renders a texture to the screen, by default it obtains each pixel colour by interpolating nearby texels. You can disable this behaviour by switching to the GL_NEAREST interpolation mode, however you then lose the benefits of smooth scaling, distortion, rotation and sub-pixel positioning.
You can alleviate the problem by always leaving a 1-pixel clear border around each image frame. This will not solve the problem if you are using mipmapping, however. At this stage you will need a 3D texture.
You can create a 3D texture from any sequence of images, or from an ImageGrid. The images must all be of the same dimension, however they need not be powers of two (pyglet takes care of this by returning TextureRegion as with a regular Texture).
In the following example, the explosion texture from above is uploaded into a 3D texture:
explosion_3d = pyglet.image.Texture3D.create_for_image_grid(explosion_seq)
You could also have stored each image as a separate file and used Texture3D.create_for_images to create the 3D texture.
Once created, a 3D texture behaves like any other ImageSequence; slices return TextureRegion for an image plane within the texture. Unlike a TextureGrid, though, you cannot blit a Texture3D in its entirety.
Texture bins and atlases¶
Image grids are useful when the artist has good tools to construct the larger images of the appropriate format, and the contained images all have the same size. However it is often simpler to keep individual images as separate files on disk, and only combine them into larger textures at runtime for efficiency.
A TextureAtlas is initially an empty texture, but images of any size can be added to it at any time. The atlas takes care of tracking the “free” areas within the texture, and of placing images at appropriate locations within the texture to avoid overlap.
It’s possible for a TextureAtlas to run out of space for new images, so applications will need to either know the correct size of the texture to allocate initally, or maintain multiple atlases as each one fills up.
The TextureBin class provides a simple means to manage multiple atlases. The following example loads a list of images, then inserts those images into a texture bin. The resulting list is a list of TextureRegion images that map into the larger shared texture atlases:
images = [
pyglet.image.load('img1.png'),
pyglet.image.load('img2.png'),
# ...
]
bin = pyglet.image.atlas.TextureBin()
images = [bin.add(image) for image in images]
The pyglet.resource module (see Application resources) uses texture bins internally to efficiently pack images automatically.
Animations¶
While image sequences and atlases provide storage for related images, they alone are not enough to describe a complete animation.
The Animation class manages a list of AnimationFrame objects, each of which references an image and a duration, in seconds. The storage of the images is up to the application developer: they can each be discrete, or packed into a texture atlas, or any other technique.
An animation can be loaded directly from a GIF 89a image file with load_animation (supported on Linux, Mac OS X and Windows) or constructed manually from a list of images or an image sequence using the class methods (in which case the timing information will also need to be provided). The add_to_texture_bin method provides a convenient way to pack the image frames into a texture bin for efficient access.
Individual frames can be accessed by the application for use with any kind of rendering, or the entire animation can be used directly with a Sprite (see next section).
The following example loads a GIF animation and packs the images in that animation into a texture bin. A sprite is used to display the animation in the window:
animation = pyglet.image.load_animation('animation.gif')
bin = pyglet.image.atlas.TextureBin()
animation.add_to_texture_bin(bin)
sprite = pyglet.sprite.Sprite(animation)
window = pyglet.window.Window()
@window.event
def on_draw():
sprite.draw()
pyglet.app.run()
When animations are loaded with pyglet.resource (see Application resources) the frames are automatically packed into a texture bin.
This example program is located in examples/programming_guide/animation.py, along with a sample GIF animation file.
Buffer images¶
pyglet provides a basic representation of the framebuffer as components of the AbstractImage hierarchy. At this stage this representation is based off OpenGL 1.1, and there is no support for newer features such as framebuffer objects. Of course, this doesn’t prevent you using framebuffer objects in your programs – pyglet.gl provides this functionality – just that they are not represented as AbstractImage types.
A framebuffer consists of
- One or more colour buffers, represented by ColorBufferImage
- An optional depth buffer, represented by DepthBufferImage
- An optional stencil buffer, with each bit represented by BufferImageMask
- Any number of auxilliary buffers, also represented by ColorBufferImage
You cannot create the buffer images directly; instead you must obtain instances via the BufferManager. Use get_buffer_manager to get this singleton:
buffers = image.get_buffer_manager()
Only the back-left color buffer can be obtained (i.e., the front buffer is inaccessible, and stereo contexts are not supported by the buffer manager):
color_buffer = buffers.get_color_buffer()
This buffer can be treated like any other image. For example, you could copy it to a texture, obtain its pixel data, save it to a file, and so on. Using the texture attribute is particularly useful, as it allows you to perform multipass rendering effects without needing a render-to-texture extension.
The depth buffer can be obtained similarly:
depth_buffer = buffers.get_depth_buffer()
When a depth buffer is converted to a texture, the class used will be a DepthTexture, suitable for use with shadow map techniques.
The auxilliary buffers and stencil bits are obtained by requesting one, which will then be marked as “in-use”. This permits multiple libraries and your application to work together without clashes in stencil bits or auxilliary buffer names. For example, to obtain a free stencil bit:
mask = buffers.get_buffer_mask()
The buffer manager maintains a weak reference to the buffer mask, so that when you release all references to it, it will be returned to the pool of available masks.
Similarly, a free auxilliary buffer is obtained:
aux_buffer = buffers.get_aux_buffer()
When using the stencil or auxilliary buffers, make sure you explicitly request these when creating the window. See OpenGL configuration options for details.
Displaying images¶
Images should be drawn into a window in the window’s on_draw event handler. Usually a “sprite” should be created for each appearance of the image on-screen. Images can also be drawn directly without creating a sprite.
Sprites¶
A sprite is an instance of an image displayed in the window. Multiple sprites can share the same image; for example, hundreds of bullet sprites might share the same bullet image.
A sprite is constructed given an image or animation, and drawn with the Sprite.draw method:
sprite = pyglet.sprite.Sprite(image)
@window.event
def on_draw():
window.clear()
sprite.draw()
Sprites have properties for setting the position, rotation, scale, opacity, color tint and visibility of the displayed image. Sprites automatically handle displaying the most up-to-date frame of an animation. The following example uses a scheduled function to gradually move the sprite across the screen:
def update(dt):
# Move 10 pixels per second
sprite.x += dt * 10
# Call update 60 times a second
pyglet.clock.schedule_interval(update, 1/60.)
If you need to draw many sprites, use a Batch to draw them all at once. This is far more efficient than calling draw on each of them in a loop:
batch = pyglet.graphics.Batch()
sprites = [pyglet.sprite.Sprite(image, batch=batch),
pyglet.sprite.Sprite(image, batch=batch),
# ... ]
@window.event
def on_draw():
window.clear()
batch.draw()
When sprites are collected into a batch, no guarantee is made about the order in which they will be drawn. If you need to ensure some sprites are drawn before others (for example, landscape tiles might be drawn before character sprites, which might be drawn before some particle effect sprites), use two or more OrderedGroup objects to specify the draw order:
batch = pyglet.graphics.Batch()
background = pyglet.graphics.OrderedGroup(0)
foreground = pyglet.graphics.OrderedGroup(1)
sprites = [pyglet.sprite.Sprite(image, batch=batch, group=background),
pyglet.sprite.Sprite(image, batch=batch, group=background),
pyglet.sprite.Sprite(image, batch=batch, group=foreground),
pyglet.sprite.Sprite(image, batch=batch, group=foreground),
# ...]
@window.event
def on_draw():
window.clear()
batch.draw()
See the Graphics section for more details on batch and group rendering.
For best performance, try to collect all batch images into as few textures as possible; for example, by loading images with pyglet.resource.image (see Application resources) or with Texture bins and atlases).
Simple image blitting¶
A simple but less efficient way to draw an image directly into a window is with the blit method:
@window.event
def on_draw():
window.clear()
image.blit(x, y)
The x and y coordinates locate where to draw the anchor point of the image. For example, to center the image at (x, y):
kitten.anchor_x = kitten.width // 2
kitten.anchor_y = kitten.height // 2
kitten.blit(x, y)
You can also specify an optional z component to the blit method. This has no effect unless you have changed the default projection or enabled depth testing. In the following example, the second image is drawn behind the first, even though it is drawn after it:
from pyglet.gl import *
glEnable(GL_DEPTH_TEST)
kitten.blit(x, y, 0)
kitten.blit(x, y, -0.5)
The default pyglet projection has a depth range of (-1, 1) – images drawn with a z value outside this range will not be visible, regardless of whether depth testing is enabled or not.
Images with an alpha channel can be blended with the existing framebuffer. To do this you need to supply OpenGL with a blend equation. The following code fragment implements the most common form of alpha blending, however other techniques are also possible:
from pyglet.gl import *
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
You would only need to call the code above once during your program, before you draw any images (this is not necessary when using only sprites).
OpenGL imaging¶
This section assumes you are familiar with texture mapping in OpenGL (for example, chapter 9 of the OpenGL Programming Guide).
To create a texture from any AbstractImage, call get_texture:
kitten = image.load('kitten.jpg')
texture = kitten.get_texture()
Textures are automatically created and used by ImageData when blitted. It is useful to use textures directly when aiming for high performance or 3D applications.
The Texture class represents any texture object. The target attribute gives the texture target (for example, GL_TEXTURE_2D) and id the texture name. For example, to bind a texture:
glBindTexture(texture.target, texture.id)
Texture dimensions¶
Implementations of OpenGL prior to 2.0 require textures to have dimensions that are powers of two (i.e., 1, 2, 4, 8, 16, ...). Because of this restriction, pyglet will always create textures of these dimensions (there are several non-conformant post-2.0 implementations). This could have unexpected results for a user blitting a texture loaded from a file of non-standard dimensions. To remedy this, pyglet returns a TextureRegion of the larger texture corresponding to just the part of the texture covered by the original image.
A TextureRegion has an owner attribute that references the larger texture. The following session demonstrates this:
>>> rgba = image.load('tests/image/rgba.png')
>>> rgba
<ImageData 235x257> # The image is 235x257
>>> rgba.get_texture()
<TextureRegion 235x257> # The returned texture is a region
>>> rgba.get_texture().owner
<Texture 256x512> # The owning texture has power-2 dimensions
>>>
A TextureRegion defines a tex_coords attribute that gives the texture coordinates to use for a quad mapping the whole image. tex_coords is a 4-tuple of 3-tuple of floats; i.e., each texture coordinate is given in 3 dimensions. The following code can be used to render a quad for a texture region:
texture = kitten.get_texture()
t = texture.tex_coords
w, h = texture.width, texture.height
array = (GLfloat * 32)(
t[0][0], t[0][1], t[0][2], 1.,
x, y, z, 1.,
t[1][0], t[1][1], t[1][2], 1.,
x + w, y, z, 1.,
t[2][0], t[2][1], t[2][2], 1.,
x + w, y + h, z, 1.,
t[3][0], t[3][1], t[3][2], 1.,
x, y + h, z, 1.)
glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT)
glInterleavedArrays(GL_T4F_V4F, 0, array)
glDrawArrays(GL_QUADS, 0, 4)
glPopClientAttrib()
The Texture.blit method does this.
Use the Texture.create method to create either a texture region from a larger power-2 sized texture, or a texture with the exact dimensions using the GL_texture_rectangle_ARB extension.
Texture internal format¶
pyglet automatically selects an internal format for the texture based on the source image’s format attribute. The following table describes how it is selected.
Format Internal format Any format with 3 components GL_RGB Any format with 2 components GL_LUMINANCE_ALPHA "A" GL_ALPHA "L" GL_LUMINANCE "I" GL_INTENSITY Any other format GL_RGBA
Note that this table does not imply any mapping between format components and their OpenGL counterparts. For example, an image with format "RG" will use GL_LUMINANCE_ALPHA as its internal format; the luminance channel will be averaged from the red and green components, and the alpha channel will be empty (maximal).
Use the Texture.create class method to create a texture with a specific internal format.
Saving an image¶
Any image can be saved using the save method:
kitten.save('kitten.png')
or, specifying a file-like object:
kitten_stream = open('kitten.png', 'wb')
kitten.save('kitten.png', file=kitten_stream)
The following example shows how to grab a screenshot of your application window:
pyglet.image.get_buffer_manager().get_color_buffer().save('screenshot.png')
Note that images can only be saved in the PNG format unless PIL is installed.


gamej is a collection of files to help with making games with Java Graphics2D. This is mainly meant for pixel art games, as the way stuff is rendered is very pixelated.
Use this template as a starting point and find the rest of the files here, or download this template with everything ready to go
import game.*;
public class Template extends GameJava {
public Template() {
super(640, 480, 60, 60);
LoopManager.startLoops(this);
}
public static void main(String[] args) {
new Template();
}
@Override
public void update() {
// called at the set frame rate
}
@Override
public void draw() {
// called at the set update rate
}
@Override
public void absoluteDraw() {
// called immediately after draw, all drawing is the same but without the camera affecting anything
}
}
Your main loops will be in a class that extends GameJava
Images (.png or .jpg) will automatically be loaded from the assets/images folder in your project. Audio (.wav or .mp3) will automatically be loaded from the assets/audio folder. Any subfolders in said directories will also be scanned for assets
Starting the game requires the class that extends GameJava to be constructed with super(width, height, frame rate, update rate);, and the LoopManager to be started with LoopManager.startLoops(this);
If you need to run code once before the game, call it in the construter after super, and before LoopManager.startLoops
There are a few things built in that can be ran here
String frameTitle - what you want the frame title to be
Boolean allowFullScreen - should full screen be enabled. Use full screen by pressing f11. Fullscreen is very buggy and it is recommended that it be disabled
Boolean resizable - should the user be allowed to resize the window
Boolean Draw.antialiasing - if antialiasing should be used
Float Draw.alphaBetweenFrames - used for motion blur, 0.01f is a lot, 1.0f is none
There are three methods in the main class
update - will try to be called at the set update rate
draw - will try to be called at the set frame rate
functions found in graphics can be called here
absoluteDraw called after draw and is the same, but the camera is ignored by and method called in here
gw - game width
gh - game height
Draw.setWindowSize(w, h) - sets the size of the window
Draw.setColor(Color) - sets the color to draw with
Draw.setLineWidth(width) - sets the lines width
Draw.setFontSize(size) - sets the font size to the number entered x 8 pixels
Draw.getWidthOfText(text) - returns the width of a String if it were to be drawn
Draw.rect(x, y, w, h) or (Rect) - draws a rectangle centered on x, y
Draw.rectOutline(x, y, w, h) or (Rect) - draws a rectangle outline centered on x, y
Draw.circle(x, y, r) or (Circle) - draws a circle centered on x, y
Draw.circleOutline(x, y, r) or (Circle) - draws a circle outline centered on x, y
Draw.line(x1, y1, x2, y2) or (Point, Point) - line from x1,y1 to x2,y2
Draw.arc(x, y, size, start angle, arc angle) - draws an arc
Draw.text(text, x, y) - draws a string. x,y should be top left
Draw.image(name, x, y) or (name, x, y, angle, scale) - draws an image specified by a string which is the name of the file without the extension (assets/images/example.png would be "example"). centered on x,y at an angle in radians, scaled based on scale
Draw.imageIgnoreCutoff(name, x, y) or (name, x, y, angle, scale) - same as image, but will draw even if it is consider not visible
The camera will offset all graphics according to its values
Camera.x - x offset of graphics
Camera.y - y offset of graphics
Camera.zoom - amount graphics are scaled by. Partial numbers work, but whole numbers look better
Camera.angle - angle, in radians, the graphics are rotated by
Camera.centerCameraOn(x, y) or (Point) - centers the x and y of the camera on the x and y passed in
Camera.moveCamera(x, y) - moves the camera taking into account the angle. Example: move camera "forwards" moveCamera(0, -1)
3 different data types can be used for physics (which is just collision detection), points, circles, and rectangles. Make sure you are importing the gamej versions, not the ones built into java
new Point(x, y)
new Circle(x, y, r)
new Rectangle(x, y, w, h)
detect collision between and
returns true if there is a collision, returns false if no collision
dist(x1, y1, x2, y2) or (point, point) - returns the distance between two points
Sounds.play(sound name) - plays a sound. The String should be the file name without the extension (assets/audio/example.wav would be "example")
Sounds.loop(sound name) - plays a sound and sets it to loop every time it finishes
Sounds.ajustGain(sound name, volume) - sets the gain for a sound. 1.0f is the default volume, 0.0f is no sound
Sounds.stop(sound name) - stops the sound if it is playing
Input.keyDown(key code) - True when a key is held down. keyCode can be an int if you know it, or use the KeyCodes enum. for example if(Input.keyDown(KeyCodes.A)) {}
Input.keyPress(key code) - same as keyDown, but only true the first frame a key is pressed
Input.mouseDown(buttonID) - True when a mouse button is held down
Input.mousePress(buttonID) - same as mouseDown, but only true the first frame a button is pressed
mouse buttons - 0 = LMB, 1 = middle click, 2 = RMB
Input.mousePos - a Point containing the mouse position in the world
Input.rawMousePos - a Point containing the mouse position ignoring the camera
Utils.pointTo(x1, y1, x2, y2) or (Point, target Point) - returns the angle (in radians) between point, and target point
Utils.turnTo(current angle, target angle, turn speed) - returns a number that is the current angle turn towards target angle, by turn speed amount
Utils.rand(minimum, maximum) - returns a random whole number between the minimum and maximum (both inclusive)
Utils.lerp(start, end, amount) - moves one value towards another
Utils.friction(value, amount) - moves a value towards 0 by the amount, once close to 0 the value will snap to 0
Utils.limit(value, max, min) - clamps a value between a min and max
Utils.mapRange(value, value low, value high, remapped low, remapped high) - changes a value in one range, to its equivalent value in another
The debug menu can be shown by pressing f3
Utils.putInDebugMenu(label, value) - puts a value in the debug menu


| MATLAB File Help: prtDecisionBinary |
prtDecisionBinary Base class for all prtDecisionBinary objects A prtDecisionBinary object is an abstract class and cannot be instantiated. prtBinaryDecsion objects find a threshold value that is used to make decisions based on certain criteria. prtDecisionBinary objects all have the following function: getThreshold - return the prtDecisionBinary objects decision threshold
| Superclasses | prtDecision |
| Sealed | false |
| Construct on load | false |
| prtDecisionBinary | Base class for all prtDecisionBinary objects |
| dataSet | The training prtDataSet, only stored if verboseStorage is true. |
| dataSetSummary | Structure that summarizes prtDataSet. |
| isCrossValidateValid | True |
| isSupervised | False |
| isTrained | Indicates if prtAction object has been trained. |
| name | Descriptive name of prtAction object. |
| nameAbbreviation | Shortened name for the prtAction object. |
| showProgressBar | |
| userData | User specified data |
| verboseStorage | Specifies whether or not to store the training prtDataset. |
| crossValidate | Cross validate prtAction using prtDataSet and cross validation keys. | |
| get | get the object properties | |
| kfolds | Perform K-folds cross validation of prtAction | |
| optimize | Optimize action parameter by exhaustive function maximization. | |
| run | Run a prtAction object on a prtDataSet object. | |
| set | set the object properties | |
| train | Train a prtAction object using training a prtDataSet object. | |
| Abstract | getThreshold |