๐
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
| import java.lang.reflect.InvocationTargetException; | |
| import java.util.HashMap; | |
| /** | |
| * Created by LikeJust on 2017-08-19. | |
| * TODO: Question | |
| */ | |
| public class HuWa { | |
| static public void main(String[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, CloneNotSupportedException { | |
| System.out.println(); |
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
| from PIL import Image, ImageDraw | |
| im = Image.open(img_path + filter_files[0]) # path | |
| im = im.resize((img_y_size, img_x_size), 1) | |
| draw = ImageDraw.Draw(im) | |
| draw.rectangle(((0, 0), (100, 100)), outline='red') | |
| im.save('result.jpg', 'JPEG') |
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
| import java.io.Serializable; | |
| // custom data class | |
| // must implements Serializable | |
| public class MyData implements Serializable { | |
| int id; | |
| String name; | |
| MyData(int id, String name) { |
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 is_pan(const char *str) | |
| { | |
| int arr[26] = { 0 }; | |
| int i=0; | |
| while (str[i] != '') | |
| { | |
| ++arr[(str[i++] | 32) - 'a']; | |
| } |
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
| import os | |
| for idx, name in enumerate(os.listdir('.')): | |
| os.rename(name, str(idx) + '.png') |
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 <stdio.h> | |
| #include <curl/curl.h> | |
| int main() | |
| { | |
| CURL *hnd = curl_easy_init(); | |
| curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST"); | |
| curl_easy_setopt(hnd, CURLOPT_URL, "https://openapi.naver.com/v1/papago/n2mt"); |
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
| import numpy as np | |
| import pandas as pd | |
| import tensorflow as tf | |
| train = pd.read_csv("data_bike/train.csv", parse_dates=["datetime"]) | |
| test = train[:2000] | |
| train= train[2000:] | |
| feature=['temp', 'atemp', 'humidity', 'windspeed', 'casual', 'registered'] |
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
| import com.google.gson.Gson; | |
| import com.google.gson.GsonBuilder; | |
| import com.google.maps.DirectionsApi; | |
| import com.google.maps.GeoApiContext; | |
| import com.google.maps.GeocodingApi; | |
| import com.google.maps.errors.ApiException; | |
| import com.google.maps.model.DirectionsResult; | |
| import com.google.maps.model.GeocodingResult; | |
| import com.google.maps.model.TravelMode; |
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
| Iterable<DataSnapshot> dataSnapshots = dataSnapshot.getChildren(); | |
| for (DataSnapshot tempSnapshot : dataSnapshots) { | |
| String value = tempSnapshot.getValue().toString(); | |
| String key = tempSnapshot.getKey(); | |
| if (key.equals("num")) { | |
| Log.e(TAG, value); | |
| } else if (key.equals("value")) { | |
| Log.e(TAG, value); |
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
| from __future__ import print_function # for compatibility with both python 2 and 3 | |
| from subprocess import call # for calling mplayer and lame | |
| import os # help with file handling | |
| def check_file_exists(directory, filename, extension): | |
| path = directory + "/" + filename + extension | |
| return os.path.isfile(path) | |
OlderNewer