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
import python | |
from Call call, Name name, Subscript sub, Slice sl, Expr stop | |
where call.getFunc() = name and name.getId() = "sorted" and sub.getValue() = call and sub.getIndex() = sl and sl.getStop() = stop | |
and (stop instanceof IntegerLiteral or stop instanceof Name) | |
select call, sl, "Check if call to 'sorted(data)[:n]' can be replaced with faster 'heapq.nsmallest(n, data)' or even 'min(data)'." | |
// Example Results include: sorted(nums)[:5], sorted(data)[:n], sorted(data, reverse=True, key=keyfunc)[:123] |
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
internal class CustomerTestingClass | |
{ | |
/// <summary> | |
/// Can be set to a custom value | |
/// </summary> | |
public string IsCustomer { get; set; } | |
/// <summary> | |
/// Is not required but if IsCustomer is set to "Yes" this value must not be default i.e. null |
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
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:flutter_redux/flutter_redux.dart'; | |
import 'package:pjapp_flutter/actions/errors_action.dart'; | |
import 'package:pjapp_flutter/models/app_state.dart'; | |
import 'package:redux/redux.dart'; | |
class ErrorSnackbar extends StatelessWidget { | |
ErrorSnackbar({Key key}) : super(key: key); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int gibGößtesEndstück(int n, int g, int i){ | |
return (n%100 >= n%10 && n%100 > 0) | |
? gibGößtesEndstück( n/10, g = n%100, i++ ) | |
: n = n - (n/10^i) * 10^i | |
; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tset |