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
Show hidden characters
| { | |
| "presets": [ | |
| "typescript", | |
| "react", | |
| [ | |
| "env", | |
| { | |
| "targets": { | |
| "uglify": true | |
| } |
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 main | |
| import ( | |
| "errors" | |
| "fmt" | |
| "net" | |
| "os" | |
| "strconv" | |
| "strings" | |
| "time" |
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
| func redirectTLS(w http.ResponseWriter, r *http.Request) bool { | |
| if r.TLS != nil { | |
| return false | |
| } | |
| requestHost := r.Host | |
| if strings.HasPrefix(requestHost, "http://") { | |
| requestHost = strings.Replace(requestHost, "http://", "https://", 1) | |
| } else { | |
| requestHost = "https://" + requestHost | |
| } |
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 com.LearnImmersive.Lingoland; | |
| import android.os.AsyncTask; | |
| import android.os.Build; | |
| import android.util.Log; | |
| import java.net.DatagramPacket; | |
| import java.net.DatagramSocket; | |
| import java.net.InetAddress; |
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
| // pre-condition: (x0 >= 0 && x0 < width && y0 >= 0 && y0 < height) | |
| void draw_polar_line(CImg<unsigned char>& img, int x0, float y0, float theta) | |
| { | |
| int width = img.width(), height = img.height(); | |
| theta = fmod(theta, 2*PI); | |
| int dir = 0; | |
| float delta_y = height; | |
| if (are_same(theta, 3*PI/2)) | |
| delta_y = -delta_y; |