Skip to content

Instantly share code, notes, and snippets.

testing=5
from __future__ import print_function
import cv2
import json
import numpy as np
import socket
import sys
import pickle
import os
from time import sleep
import time
from __future__ import print_function
import cv2
import json
import numpy as np
import socket
import sys
import pickle
import os
from time import sleep
import struct ### new code
from __future__ import print_function
import cv2
import json
import numpy as np
import socket
import sys
import pickle
import os
from time import sleep
import struct ### new code
# some helpers
from fractions import Fraction
def idMatx(size):
id = []
for i in range(size):
id.append([Fraction(0, 1)] * size)
for i in range(size):
id[i][i] = Fraction(1, 1)
Doomsday Fuel
=============
Making fuel for the LAMBCHOP's reactor core is a tricky process because of the exotic matter involved. It starts as raw ore, then
during processing, begins randomly changing between forms, eventually reaching a stable form. There may be multiple stable forms that a
sample could ultimately reach, not all of which are useful as fuel.
Commander Lambda has tasked you to help the scientists increase fuel creation efficiency by predicting the end state of a given ore
sample. You have carefully studied the different structures that the ore can take and which transitions it undergoes. It appears that,
while random, the probability of each structure transforming is fixed. That is, each time the ore is in 1 state, it has the same
/* eslint-disable func-names */
/* eslint quote-props: ["error", "consistent"]*/
/**
* This sample demonstrates a simple skill built with the Amazon Alexa Skills
* nodejs skill development kit.
* This sample supports multiple lauguages. (en-US, en-GB, de-DE).
* The Intent Schema, Custom Slots and Sample Utterances for this skill, as well
* as testing instructions are located at https://github.com/alexa/skill-sample-nodejs-fact
**/
/* eslint-disable func-names */
/* eslint quote-props: ["error", "consistent"]*/
/**
* This sample demonstrates a simple skill built with the Amazon Alexa Skills
* nodejs skill development kit.
* This sample supports multiple lauguages. (en-US, en-GB, de-DE).
* The Intent Schema, Custom Slots and Sample Utterances for this skill, as well
* as testing instructions are located at https://github.com/alexa/skill-sample-nodejs-fact
**/
from __future__ import print_function
import cv2
import numpy as np
import socket
import sys
import pickle
import os
from time import sleep
import struct ### new code
cap=cv2.VideoCapture(0)