It's my swan song!
#Region "Structs" Private Structure DayWeatherData Public dtDate As Date Public strLowTempF As String Public strHighTempF As String Public strLowTempC As String Public strHighTempC As String Public strCloudIconURL As String End Structure Private Structure WeatherTable Public nodTimeLayout As XmlNode Public nodData As XmlNode End Structure #End Region #Region "NWS XML Reader http://www.nws.noaa.gov/forecasts/xml" 'Converted to VB.Net by Ronald M. Clifford 'Original C#.Net by Mikhail Arkhipov Private Function FindLayoutTable(ByVal xmlDoc As XmlDocument, ByVal nodData As XmlNode) Dim nlTimeLayouts As XmlNodeList = xmlDoc.SelectNodes("/dwml/data/time-layout") Dim strTimeLayout As String = nodData.Attributes("time-layout").Value Dim node As XmlNode For Each node In nlTimeLayouts If strTimeLayout = node.SelectSingleNode("layout-key").InnerText Then Return node End If Next Return Nothing End Function Private Sub FillLowTemperatures(ByVal nodXML As XmlNode, ByRef dwdData() As DayWeatherData) Dim nlNodes As XmlNodeList = nodXML.SelectNodes("value") Dim intCount As Integer For intCount = 0 To UBound(dwdData) - 1 dwdData(intCount).strLowTempF = nlNodes(intCount).InnerText dwdData(intCount).strLowTempC = Math.Round(5 * (Double.Parse(dwdData(intCount).strLowTempF) - 32) / 9).ToString Next End Sub Private Sub FillHighTemperatures(ByVal nodXML As XmlNode, ByRef dwdData() As DayWeatherData) Dim nlNodes As XmlNodeList = nodXML.SelectNodes("value") Dim intCount As Integer For intCount = 0 To UBound(dwdData) - 1 dwdData(intCount).strHighTempF = nlNodes(intCount).InnerText dwdData(intCount).strHighTempC = Math.Round(5 * (Double.Parse(dwdData(intCount).strHighTempF) - 32) / 9).ToString Next End Sub Private Function ParseDateTime(ByVal str As String) As Date Return Date.Parse(str.Replace("T", " ").Substring(0, str.LastIndexOf("-"))) End Function Private Sub FillDayNameAndTime(ByVal nodLows As XmlNodeList, ByVal nodHighs As XmlNodeList, ByRef dwdData() As DayWeatherData) ' Choose first elemnt from low or high list depending on what is close to the current time. ' Typically weather report is about 'today' or 'tonight' on the current day or about ' day temperatures for the coming days. Therefoce remaining elements always come from ' the high temperatures list. Dim dtFirstLow As Date = ParseDateTime(nodLows(0).InnerText) Dim dtFirstHigh As Date = ParseDateTime(nodHighs(0).InnerText) Dim dtNow As Date = Now Dim nlNodes As XmlNodeList If dtFirstLow.Day = dtNow.Day And dtFirstHigh.Day = dtNow.Day Then ' choose nearest Dim intDiffFromLow = Math.Abs(dtFirstLow.Hour - dtNow.Hour) Dim intDiffFromHigh = Math.Abs(dtFirstHigh.Hour - dtNow.Hour) If intDiffFromHigh < intDiffFromLow Then nlNodes = nodHighs Else nlNodes = nodLows End If ElseIf dtFirstHigh.Day = dtNow.Day Then ' choose highs nlNodes = nodHighs Else ' choose lows nlNodes = nodLows End If Dim intCount As Integer For intCount = 0 To UBound(dwdData) - 1 Dim dt As Date = ParseDateTime(nlNodes(intCount).InnerText) If intCount = 0 Then dwdData(intCount).dtDate = dt Else dwdData(intCount).dtDate = New Date(dt.Year, dt.Month, dt.Day, 12, 0, 0) End If Next End Sub Private Sub FillCloudData(ByVal wt As WeatherTable, ByRef dwdData() As DayWeatherData) ' Cloud data is typically much longer than day high/low data ' We need to find times that match ones in high and low temp tables. Dim nlTimes As XmlNodeList = wt.nodTimeLayout.SelectNodes("start-valid-time") Dim nlIcons As XmlNodeList = wt.nodData.SelectNodes("icon-link") Dim intWeatherData As Integer = 0 Dim intNodes As Integer = 0 Dim intHourDiff As Integer = Integer.MaxValue Dim nodXML As XmlNode For Each nodXML In nlTimes Dim dt As Date = ParseDateTime(nodXML.InnerText) If dt.Date > dwdData(intWeatherData).dtDate.Date Then intWeatherData += 1 If intWeatherData > UBound(dwdData) Then Exit For intHourDiff = Integer.MaxValue End If If dt.Date = dwdData(intWeatherData).dtDate.Date Then Dim intDiff As Integer = Math.Abs(dt.Hour - dwdData(intWeatherData).dtDate.Hour) If intDiff < intHourDiff Then intHourDiff = intDiff dwdData(intWeatherData).strCloudIconURL = nlIcons(intNodes).InnerText End If End If intNodes += 1 Next End Sub Private Function ParseWeatherXML(ByVal strXMLWeather) As DayWeatherData() Try Dim dwd() As DayWeatherData Dim xmlDoc As New XmlDocument() ' load XML data into a tree xmlDoc.LoadXml(strXMLWeather) ' locate dwml/data/time-layout nodes. There should be three of them: ' - next week nighttime temperatures (lows) ' - next week daytime temperatures (highs) ' - next week cloud data ' Find roots nodes for temperature and cloud data Dim wtLowTemp As New WeatherTable() Dim wtHighTemp As New WeatherTable() Dim wtClouds As New WeatherTable() wtLowTemp.nodData = xmlDoc.SelectSingleNode("/dwml/data/parameters/temperature[@type='minimum']") wtHighTemp.nodData = xmlDoc.SelectSingleNode("/dwml/data/parameters/temperature[@type='maximum']") wtClouds.nodData = xmlDoc.SelectSingleNode("/dwml/data/parameters/conditions-icon") ' Find out corresponding time layout table for each top data node wtLowTemp.nodTimeLayout = FindLayoutTable(xmlDoc, wtLowTemp.nodData) wtHighTemp.nodTimeLayout = FindLayoutTable(xmlDoc, wtHighTemp.nodData) wtClouds.nodTimeLayout = FindLayoutTable(xmlDoc, wtClouds.nodData) ' Number of day data is min of low and high temperatures Dim nlLowTimes As XmlNodeList = wtLowTemp.nodTimeLayout.SelectNodes("start-valid-time") Dim nlHighTimes As XmlNodeList = wtHighTemp.nodTimeLayout.SelectNodes("start-valid-time") Dim intTimes As Integer = Math.Min(nlLowTimes.Count, nlHighTimes.Count) Dim dwdData(intTimes) As DayWeatherData Dim intCount As Integer For intCount = 0 To intTimes - 1 dwdData(intCount) = New DayWeatherData() Next ' Fill highs and lows FillLowTemperatures(wtLowTemp.nodData, dwdData) FillHighTemperatures(wtHighTemp.nodData, dwdData) FillDayNameAndTime(nlLowTimes, nlHighTimes, dwdData) FillCloudData(wtClouds, dwdData) Return dwdData Catch ex As Exception Return Nothing End Try End Function #End Region
Dim weather As New gov.weather.ndfdXML() Dim params As New gov.weather.weatherParametersType() params.maxt = True params.mint = True params.icons = True Dim strWeatherXML As String = weather.NDFDgen(39, -77, "time-series", Now, Now.AddDays(5), params) weather = Nothing params = Nothing Dim dwdWeather() As DayWeatherData = ParseWeatherXML(strWeatherXML)
Is that... T-Pain?
Take a good hard look at the mother fucking float.
Did you know that Pavlov's hair was famously soft and silky?
It's because he conditioned it. :ablobcatlurk:
And when the groundhog saw its shadow, the people declared:
"FOUR MORE YEARS OF STRESS EATING!"
Boss: "We need to come up with a number of hours it will take to do this super big project."
Me: "Do you want that number written out, or can I use exponential form?"
π
I guess you CAN'T do it with True Value. https://www.cnn.com/2024/10/14/business/true-value-bankruptcy
Former 2 time world champion DogPlayingTetris becomes the first player to ever rollover the level counter in NES Tetris, performing what's known in the community as "Rebirth". Final score: 29,486,164, 4216 lines, level 347 (256 + 91)... all huge world records. #tetris
Back row... Mother with screaming infant, 300 lb linebacker, and me. Or what's left of me. #airporthell
I'd also love a 6 hour layover overnight instead of taking the red eye I was going to take and be 7 hours later getting into Cleveland than I wanted, why do you ask? #airporthell
Why yes, I'd love to leave at 4:40 to get to the airport at 6:20 for an 8:20 flight that got delayed to 9:05 which is too late for my connection so now I'm on a 10:20 flight instead. Why do you ask? #airporthell
I've never had as much fun on comms for a Tetris match as I did tonight with NinjaOfNinjas for the silver bracket semis and finals. What a show!
I'm not done! I'll be casting the later rounds of the silver bracket today at 6:30 PM Pacific at https://twitch.tv/classictetris3. Cya there!
I'll be live casting qualifiers today for CTWC at https://twitch.tv/classictetris2 at 1 PM Pacific and https://twitch.tv/classictetris3 at 3:30 PM Pacific. This year's CTWC is the craziest yet so don't miss it!
Just a note to everyone out there who still believes 2020 hasn't ended that today is Unquinquaginember 21st, 2020.
@shanselman Who at Microsoft do I have to bribe to fix ADO so that those of us on dark mode who copy/paste text from one task to another can do so without our friends on light mode seeing dark text on a dark background?
I updated the blog post with a statement from Revival. While I'm not particularly happy with Revival's decision, I understand their motives. It's just a shame that it was someone from Interplay that had to go and do this. "By games for gamers" my ass.
Damn, got another Tetris world record! This time in the arcade variant developed by Atari. 6,008,005 points, 5,386 lines, round 363. Be warned, it's nearly FIVE HOURS. https://www.twitch.tv/videos/2131759212
I certainly didn't have "Overload but with web3 features" on my 2024 bingo card. WTF did Revival Productions just do?
https://roncli.com/blogger/3949527510668683306/wtf-did-revival-productions-just-do
@solitha New rule: cat tax. For every pun you post or repost, you're now required to pay the tax of posting one cute cat video.
Today was a special day. I scored 1,016,221 points in classic NES Tetris, the first time I broke the 999,999 maxout barrier.
With that maxout, I became the oldest person to get their first ever maxout at 46 years 319 days.
After I scored that, I learned that today would have been 7-time Tetris world champion Jonas Neubauer's 43rd birthday.
I am FILLED with incredible emotion tonight.
https://clips.twitch.tv/AverageImportantGoldfishHassaanChop-bRfUxo4q5SxEgJvI
"I'm Sorry, What?!" The biggest bailout in the history of Descent II! https://www.youtube.com/watch?v=GLlTk7wa59A
βBART anime merch" are three words that I would not have expected to go together, but here we are. https://www.railgoods.com/bart/anime/
Does anyone else sing the chorus to "Cherish" by Kool & The Gang to themselves whenever they play or watch streams of Balatro? Or is that just me?
I'm fact that's what Lingo needs: a "phone" block. The clue is an incorrect autocorrected form of the answer. π
It's like my phone knows I've been playing Lingo. I typed in "exited" and my phone was all:
β¬οΈ EXCITED ------
βͺοΈ
βͺοΈ
A comparison of the classic Tetris and Descent communities. Not a post I write lightly, either.
https://roncli.com/blogger/3703157809000934742/a-tale-of-two-communities
Aptiz played #Pentis again. In the beginning you can see roncli asking in the chat for the right version. About an hour later, he broke the #PentisRankings record with 60K ! Congratulations roncli π π
https://www.twitch.tv/videos/2052528360?sr=a&t=11267s
Yeah, it's season 11. But the OTL Season 6 highlight reel is up, this time Fireball has taken the reins! Check out this video jam packed full of kills, deaths, silliness, and Sirius puns. https://www.youtube.com/watch?v=SXstLVjnaGo
Over on #thatbirdhellsite, someone retweeted sympathy for the people being laid off today...
...and then said that Amazon Games was hiring. You know, the one that just had layoffs in NOVEMBER.
Honestly? Tech sucks right now.
I am so so there. I have dwdweather in hand. I am new to VB so I have no idea how to reach each item within.
I've tried a . but it tells me it is a system.array
Lost here. Help please?
dwdWeather(0)
Or use a For Each loop in order to access each of the items in order.
For Each dwd As DayWeatherData in dwdWeather
' Do something with the dwd object here.
Next