Skip to content

Instantly share code, notes, and snippets.

View devxpy's full-sized avatar

Dev Aggarwal devxpy

View GitHub Profile
#-------------------------------------------------------
# This ns script has been created by the nam editor.
# If you edit it manually, the nam editor might not
# be able to open it properly in the future.
#
# EDITING BY HAND IS AT YOUR OWN RISK!
#-------------------------------------------------------
# Create a new simulator object.
set ns [new Simulator]
# Create a nam trace datafile.
@devxpy
devxpy / ns2-win-docker.md
Last active December 12, 2019 17:46
Run ns2 on windows using docker

Run ns2 on windows:

  • Install docker for windows.
  • Log out / Log in.
  • Open "Docker Desktop" from Start menu. (Notice Icon in taskbar)
  • Restart if docker asks you to do it.
  • Install VcXsrv.
  • Open "XLaunch" from Start menu.

Check the "Disable access control" checkbox.

Running freestyle step: qemu_arm
Pulling image devxpy/micropython:sha256:33a88cefb02f7663f69110b498ab101f6e4ace81c516f3a1b794bcf2ceb61b9d
Digest: sha256:33a88cefb02f7663f69110b498ab101f6e4ace81c516f3a1b794bcf2ceb61b9d
Status: Image is up to date for r.cfcr.io/devxpy/micropython@sha256:33a88cefb02f7663f69110b498ab101f6e4ace81c516f3a1b794bcf2ceb61b9d
Finished pulling r.cfcr.io/devxpy/micropython@sha256:33a88cefb02f7663f69110b498ab101f6e4ace81c516f3a1b794bcf2ceb61b9d from internal registry
------------------------------
Executing command: . .codefresh/setup_build_step.sh
+ REPO_URL=https://github.com/devxpy/micropython.git
+ REPO_DIR=/codefresh/volume/qemu_arm
+ [ ! -d /codefresh/volume/qemu_arm ]
Running freestyle step: qemu_arm
Pulling image devxpy/micropython:sha256:0c46420a2d88fe3f11b058455def82f97672cdde6b11411ce7dda1fda0abc9eb
Digest: sha256:0c46420a2d88fe3f11b058455def82f97672cdde6b11411ce7dda1fda0abc9eb
Status: Image is up to date for r.cfcr.io/devxpy/micropython@sha256:0c46420a2d88fe3f11b058455def82f97672cdde6b11411ce7dda1fda0abc9eb
Finished pulling r.cfcr.io/devxpy/micropython@sha256:0c46420a2d88fe3f11b058455def82f97672cdde6b11411ce7dda1fda0abc9eb from internal registry
------------------------------
Executing command: . .codefresh/setup_build_step.sh
+ REPO_URL=https://github.com/devxpy/micropython.git
+ REPO_DIR=/codefresh/volume/qemu_arm
+ [ ! -d /codefresh/volume/qemu_arm ]
Preparing build
Building image: micropython:latest using unique hash: 00a72775b12a91330b48299734ad10ebdff22f43
Sending build context to Docker daemon 6.144kB
Step 1/41 : FROM ubuntu:18.04
18.04: Pulling from library/ubuntu
Digest: sha256:d1d454df0f579c6be4d8161d227462d69e163a8ff9d20a847533989cf0c94d90
Status: Image is up to date for ubuntu:18.04
---> a2a15febcdf3
[ {
"questionId" : 1,
"answerMapping" : {
"Frustrated" : "I Recognise Very Few Students. ",
"Neutral" : "",
"Happy" : " I Recognise All Students By Name.",
"Sad" : "I Recognise About Half The Students By Name. ",
"Fine" : "I Recognise Over 75% Of Students By Name. "
},
"valueRegional" : "Students are important to me.",
import select
import sys
MICROPYTHON = sys.implementation.name == "micropython"
BCAST_HOST = "255.255.255.255"
LOCAL_HOST = "0.0.0.0"
LOG_PREFIX = "[μNetwork] "
from rest_framework.parsers import FileUploadParser, MultiPartParser
from rest_framework.views import APIView
from rest_framework.response import Response
class FileUploadView(APIView):
parser_classes = (FileUploadParser, MultiPartParser)
def put(self, request, filename, format=None):
with open("uploaded_file", "wb") as f:
f.write(request.data['file'].read())
if status --is-interactive
#
# pyenv
#
. (pyenv init -|psub)
#
# virtualfish
#
@devxpy
devxpy / FlutterMethodCallDispatcher.kt
Created February 19, 2019 15:45
A scaffold for Flutter+Kotlin
import android.os.AsyncTask
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.Result
import java.lang.reflect.Method
class DoAsync(val fn: () -> Unit) : AsyncTask<Void, Void, Void>() {
init {
execute()