This file contains hidden or 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
$fn=60; | |
holeH=37; | |
holeD=12.5; | |
h=40; | |
module lampHolder() { | |
difference() { | |
holderBody(); | |
tableSpace(); |
This file contains hidden or 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
package lt.andro.learnrxjava; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.text.Editable; | |
import android.text.TextUtils; | |
import android.widget.RadioGroup; | |
import android.widget.TextView; | |
import com.jakewharton.rxbinding2.InitialValueObservable; |
This file contains hidden or 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
$fn=60; | |
module lampHandle() { | |
difference() { | |
cylinder(d=35, h = 100); | |
translate([0,0,84]){ | |
bulbSpace(); | |
} | |
holoInside(); | |
buttonHole(); |
This file contains hidden or 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
$fn=20; | |
module holder () { | |
difference() { | |
// create rounded corners cube | |
rcube([20, 30, 20]); | |
// make a hole for the screw | |
translate([10, 10, 0]) | |
screwHole(); |
This file contains hidden or 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
let Angle = 0 | |
basic.forever(() => { | |
Angle = input.compassHeading() | |
if (345 < Angle || Angle < 15) { | |
basic.showLeds(` | |
. . # . . | |
. . . . . | |
. . . . . | |
. . . . . | |
. . . . . |
This file contains hidden or 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
/* | |
Air Sensor | |
Arduino based air quality sensor | |
Sensors used: | |
DHT22 - temperature and humidity sensor | |
MQ-2 - gas leakage detector. It is suitable for detecting H2, LPG, CH4, CO, Alcohol, Smoke or Propane | |
MQ-3 - alcohol sensor is suitable for detecting alcohol concentration on your breath, just like your common breathalyzer. It has a high sensitivity and fast response time | |
MQ-7 - Carbon Monoxide (CO) sensor |
This file contains hidden or 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
... | |
Gson gson = new GsonBuilder() | |
.registerTypeAdapter(NumberOfPeople.class, NumberOfPeople.getDeserializer()) | |
.create(); | |
return new Retrofit.Builder() | |
... | |
.addConverterFactory(GsonConverterFactory.create(gson)) | |
.client(client) | |
.build(); |
This file contains hidden or 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 <Servo.h> | |
float TIMELAPSE_SPEED = 5; // N:1 | |
long COOLDOWN = 2000 * TIMELAPSE_SPEED; | |
long CYCLE = 20000 * TIMELAPSE_SPEED; | |
long ANGLE_MIN = 45; | |
long ANGLE_MAX = 135; | |
long angleRange = ANGLE_MAX - ANGLE_MIN; |
This file contains hidden or 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
int relayPin = 3; | |
int pirPin = 2; | |
int ledPin = 13; // just a LED on Arduino board. Not that huge ~18W LED lamp. | |
long lastDetection = 0; // millis | |
long DELAY = 3 * 1000; // N seconds (also adjustable at PIR sensor too) | |
void setup() { | |
pinMode(relayPin, OUTPUT); | |
pinMode(pirPin, INPUT); |
This file contains hidden or 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
class Solution { | |
public int solution(int[] A) { | |
long left = 0; | |
long right = 0; | |
long sum = sum(A); | |
for (int i = 0; i < A.length; i++) { | |
right = sum - left - A[i]; | |
if (left == right) |
NewerOlder