Python relative imports in AWS Lambda fail with attempted relative import with no known parent package
In AWS Lambda if I attempt an explicit relative import like this
.
├── lambda_file.py
└── example.py
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
// munged from https://github.com/simontime/Resead | |
namespace sead | |
{ | |
class Random | |
{ |
import { Queue } from "@aws-cdk/aws-sqs"; | |
import { App, Duration, Stack, StackProps } from "@aws-cdk/core"; | |
import { Runtime, Code, Function } from "@aws-cdk/aws-lambda"; | |
import { SqsEventSource } from "@aws-cdk/aws-lambda-event-sources"; | |
class DeadLetterQueue extends Stack { | |
constructor(parent: App, name: string, props?: StackProps) { | |
super(parent, name, props); |
This is study path related to microservices. It is not a study path on programming, if you want to improve in this sense please take a look at this.
function displaytime { | |
local T=$1 | |
local D=$((T/60/60/24)) | |
local H=$((T/60/60%24)) | |
local M=$((T/60%60)) | |
local S=$((T%60)) | |
(( $D > 0 )) && printf '%3s' $D && printf ' days ' | |
(( $H > 0 )) && printf '%2s' $H && printf ' hours ' | |
(( $M > 0 )) && printf '%2s' $M && printf ' minutes ' | |
if [ $D -lt 1 -a $H -lt 1 ] |
Aniruddh Agarwal blogged A short tour of PHP, and this is one of the negatives he identified:
Community: I know. I said that PHPs community was an advantage to it, but it is also a disadvantage, because of BAD CODE. Beginners are not taught the best practices and they go on to write bad code and distribute it, either as answers on Stack Overflow or similar websites or blog about it, which encourages other beginners to adopt those practices. There is a lot of misinformation out there, and it is very difficult to separate the good from the bad. This is perhaps the worst thing about PHP, because PHP is an entry-level language and people learning it are usually not aware of the best practices.
The existence of BAD CODE being copied and pasted by newcomers is probably the biggest source of exploitable security vulnerabilities in the entire industry.
The biggest offenders are often the highest ranking search results on Google and other search eng
.highlight { background: #ffffff; } | |
.highlight .c { color: #999988; font-style: italic } /* Comment */ | |
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ | |
.highlight .k { font-weight: bold } /* Keyword */ | |
.highlight .o { font-weight: bold } /* Operator */ | |
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */ | |
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ | |
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ | |
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ | |
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ |
# Assuming an Ubuntu Docker image | |
$ docker run -it <image> /bin/bash |
$app->hook('slim.before.dispatch', function () use ($app) { | |
$app->render('/views/header.php'); | |
}); | |
$app->hook('slim.after.dispatch', function () use ($app) { | |
$app->render('/views/footer.php'); | |
}); |