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.github.benmanes.gradle.versions.updates.DependencyUpdatesTask | |
| [...] | |
| plugins { | |
| [...] | |
| id("com.github.ben-manes.versions") | |
| } | |
| configurations { |
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
| https://www.youtube.com/watch?v=eAbKK7JNxCE | |
| fun WeatherDto.toWeatherInfo(nowTime: LocalDateTime = LocalDateTime.now()): WeatherInfo { | |
| val weatherDataMap = weatherData.toWeatherDataMap() | |
| // the API always has weather data for a full hour, like this: "2023-02-13T13:00" | |
| // we need to take care of the edge case: time is f.e. "23:50". Then we need the weather data for time "00:00" | |
| // for the NEXT day | |
| val dayIndex = if (nowTime.hour == 23 && nowTime.minute >= 30) 1 else 0 |
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
| // https://www.youtube.com/watch?v=eAbKK7JNxCE | |
| fun WeatherDataDto.toWeatherDataMap(): Map<Int, List<WeatherData>> { | |
| val mapIndexed = time.mapIndexed { index, time -> | |
| val temperature = temperatures[index] | |
| val weatherCode = weatherCodes[index] | |
| val windSpeed = windSpeeds[index] | |
| val pressure = pressures[index] | |
| val humidity = humidities[index] |
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
| # If you have connection issues from the local machine to GitHub, you can make the git command in the console more verbose. | |
| # sourcee: https://stackoverflow.com/a/20492254/1057348 | |
| # Windows | |
| set GIT_CURL_VERBOSE=1 | |
| set GIT_TRACE_PACKET=2 | |
| # Unix | |
| # export GIT_CURL_VERBOSE=1 | |
| # export GIT_TRACE_PACKET=2 |
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 mail; | |
| import javax.mail.Message; | |
| import javax.mail.MessagingException; | |
| import javax.mail.Session; | |
| import javax.mail.Transport; | |
| import javax.mail.internet.InternetAddress; | |
| import javax.mail.internet.MimeMessage; | |
| import java.util.Properties; |
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
| // Java 6 and lower: | |
| public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue(Map<K, V> map) { | |
| List<Map.Entry<K, V>> list = new LinkedList<Map.Entry<K, V>>(map.entrySet()); | |
| Collections.sort(list, new Comparator<Map.Entry<K, V>>() { | |
| public int compare(Map.Entry<K, V> o1, Map.Entry<K, V> o2) { | |
| return (o1.getValue()).compareTo(o2.getValue()); | |
| } | |
| }); | |
| Map<K, V> result = new LinkedHashMap<K, V>(); |
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
| Sub Faerbe_RGB() | |
| 'Makro von PauleVBA @ gutefrage.net | |
| Dim lngGrau As Long 'RGB-Wert fuer Grau | |
| Dim lngWeiss As Long 'RGB-Wert für weiss | |
| Dim lngEnde As Long 'Ende der gefuellten Zeilen | |
| Dim lngInterneFarbe As Long 'die gewuenschte Fuellung | |
| Dim I As Long ' einfach Zaehlvariable | |
| lngGrau = RGB(235, 235, 235) 'Farbe Grau definieren | |
| lngWeiss = RGB(255, 255, 255) 'Farbe weiss definieren |
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
| // These two need to be declared outside the try/catch | |
| // so that they can be closed in the finally block. | |
| HttpURLConnection urlConnection = null; | |
| BufferedReader reader = null; | |
| // Will contain the raw JSON response as a string. | |
| String forecastJsonStr = null; | |
| try { | |
| // Construct the URL for the OpenWeatherMap query |
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
| Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() | |
| { | |
| public void execute() | |
| { | |
| int offsetWidth = firstWidget.getOffsetWidth(); | |
| secondWidget.setWidth(offsetWidth + "px"); | |
| } | |
| }); |