This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select 'replacewithtablename' into @table; | |
| select 'replacewithdatabasename' into @schema; | |
| select GROUP_CONCAT(r.x SEPARATOR '\n') from | |
| ( | |
| select '[DataAccessObject]'as x,'grp'as grp union | |
| select concat('public abstract class ',@table,'{') as x, 'grp' as grp | |
| union | |
| select concat('[PersistedMember]\npublic abstract ',tps.dest,IF(tps.dest = 'string', ' ', IF(is_nullable = 'NO', ' ', '? ')), REPLACE(column_name, ' ', ''),' {get;set;}'), 'grp' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from time import sleep | |
| from luma.core.render import canvas | |
| from luma.led_matrix.device import ws2812 | |
| ''' | |
| Pin connections: | |
| VCC (red): 5 Volt, don't use Raspberry's power, because it may draw a lot of current | |
| DIN (green): Pin 12, GPIO18 | |
| GND (white): Common ground | |
| ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from luma.core.interface.serial import spi, noop | |
| from luma.core.render import canvas | |
| from luma.core.legacy import text | |
| from luma.core.legacy.font import LCD_FONT, proportional | |
| from luma.led_matrix.device import max7219 | |
| from time import sleep | |
| serial = spi(port=0, device=0, gpio=noop()) | |
| scoreboard = max7219(serial, cascaded=4, block_orientation=-90) | |
| scoreboard.contrast(20) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| var anzahlZahlenMitDrei = 0; | |
| for (var i = 100; i <= 999; i++) { | |
| var zahl = i; | |
| while (zahl > 0) { | |
| var letzteZiffer = zahl % 10; | |
| if (letzteZiffer == 3) { | |
| anzahlZahlenMitDrei++; | |
| break; // while-Schleife beenden | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import "dart:math" as math; | |
| void main() { | |
| var anzahlZahlenMitDrei = 0; | |
| for (var i = 100; i <= 999; i++) { | |
| for (int stelle = 6; stelle > 0; stelle--) { | |
| var wertigkeit = math.pow(10, stelle).toInt(); // 10^stelle | |
| var hintenAbgeschnitten = i ~/ (wertigkeit ~/ 10); | |
| var vorneAbgeschnitten = hintenAbgeschnitten % 10; | |
| if (vorneAbgeschnitten == 3) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| var anzahlZahlenMitDrei = 0; | |
| for (var i = 100; i <= 999; i++) { | |
| // Nachteil: muss für jede weitere Stelle zusätzlich programmiert werden, z.B. Tausender | |
| var hunderter = i ~/ 100; | |
| var zehner = (i - hunderter * 100) ~/ 10; | |
| var einer = (i - hunderter * 100 - zehner * 10); | |
| if (hunderter == 3 || zehner == 3 || einer == 3) { | |
| anzahlZahlenMitDrei++; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| var anzahlZahlenMitDrei = 0; | |
| for (var i = 100; i <= 999; i++) { | |
| var text = i.toString(); | |
| // Nachteil: muss für jede weitere Stelle zusätzlich programmiert werden, z.B. Tausender | |
| var hunderter = text.substring(0,1); | |
| var zehner = text.substring(1,2); | |
| var einer = text.substring(2,3); | |
| if (hunderter == "3" || zehner == "3" || einer == "3") { | |
| anzahlZahlenMitDrei++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| print(pow(2,3)); | |
| print(pow(2,4)); | |
| print(pow(3,3)); | |
| print(pow(2,0)); | |
| } | |
| int pow(int basis, int exponent) | |
| { | |
| int ergebnis = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| var liste = [1,5,9,1,0,-5,9]; | |
| print(minimum(liste)); | |
| } | |
| int minimum(List zahlen) | |
| { | |
| int min = zahlen[0]; | |
| for (int zahl in zahlen) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void onDelete(int i) | |
| { | |
| print(2); | |
| print(i); | |
| } | |
| void main() | |
| { | |
| var lambda = () => onDelete(5); | |
| lambda(); | |
OlderNewer