This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
with open("foo.txt") as f: | |
for l in f: | |
print(l) | |
print("and some other stuff") | |
print("enough stuff that a list comprehension is unfeasible") | |
except EnvironmentError as e: | |
print(f"Oh no: {e}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
background-color: #AB9C7D; | |
color: black; | |
font-family: "Trebuchet MS", Arial, Verdana, Sans-Serif; | |
font-size: 12px; | |
} | |
body { | |
width: 800px; | |
margin: auto auto; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Ada.Text_IO; | |
procedure Learn is | |
type Integer_Array is array (Natural range <>) of Integer; | |
b : Integer_Array := (1,2,3); | |
a : Integer_Array := (4,5,6); | |
begin | |
if b(0..2) < a(1..2) then | |
Ada.Text_IO.Put_Line ("HELLO"); | |
end if; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <type_traits> | |
#include <vector> | |
template<typename, typename = void> | |
struct is_std_container : std::false_type {}; | |
template<typename T> | |
struct is_std_container<T, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[src/3rdparty/squirrel/squirrel/sqclass.h:10]: (performance) Variable 'val' is assigned in constructor body. Consider performing initialization in initialization list. | |
[src/3rdparty/squirrel/squirrel/sqclass.h:11]: (performance) Variable 'attrs' is assigned in constructor body. Consider performing initialization in initialization list. | |
[src/3rdparty/squirrel/squirrel/sqclosure.h:10]: (performance) Variable '_function' is assigned in constructor body. Consider performing initialization in initialization list. | |
[src/3rdparty/squirrel/squirrel/sqclosure.h:48]: (performance) Variable '_closure' is assigned in constructor body. Consider performing initialization in initialization list. | |
[src/3rdparty/squirrel/squirrel/sqcompiler.cpp:664]: (portability) Casting from float* to integer* is not portable due to different binary data representations on different platforms. | |
[src/3rdparty/squirrel/squirrel/sqcompiler.cpp:710]: (portability) Casting from float* to integer* is not portable due to different binary data represe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) { | |
int someValue = 1; | |
int x = 10, y = 10; | |
someValue ? ++x, ++y : --x, --y; | |
printf("%d %d\n", x, y); | |
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <functional> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
template <int N> | |
int plus(int i) | |
{ | |
return i + N; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122.42794036865ms | |
47.846794128418ms | |
226.38607025146ms | |
105.95703125ms | |
194.10586357117ms | |
60.943126678467ms | |
182.0080280304ms | |
174.10182952881ms | |
103.69205474854ms | |
44.697999954224ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* $Id$ */ | |
/* | |
* This file is part of OpenTTD. | |
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. | |
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
/** @file industry_cmd.cpp Handling of industry tiles. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp | |
index 8fea6953a..4d1516cf0 100644 | |
--- a/src/industry_cmd.cpp | |
+++ b/src/industry_cmd.cpp | |
@@ -2461,39 +2461,30 @@ static void ReportNewsProductionChangeIndustry(Industry *ind, CargoID type, int | |
static const uint PERCENT_TRANSPORTED_60 = 153; | |
static const uint PERCENT_TRANSPORTED_80 = 204; | |
-/** | |
- * Change industry production or do closure |