00:31:47 | * | lucasta joined #nim |
00:47:21 | * | greaser|q quit (Changing host) |
00:47:21 | * | greaser|q joined #nim |
00:47:23 | * | greaser|q is now known as GreaseMonkey |
01:00:01 | * | nazgulsenpai quit (Quit: ZNC 1.8.2 - https://znc.in) |
01:02:30 | * | nazgulsenpai joined #nim |
01:04:46 | * | beholders_eye quit (Read error: Connection reset by peer) |
01:10:25 | * | beholders_eye joined #nim |
01:37:07 | * | beholders_eye quit (Read error: Connection reset by peer) |
01:43:12 | * | beholders_eye joined #nim |
01:57:55 | * | beholders_eye quit (Read error: Connection reset by peer) |
02:03:48 | * | beholders_eye joined #nim |
02:09:45 | FromDiscord | <bostonboston> Never understood why people complain, the most common complaint I see is consistency, but if you care just be consistent or use a tool to enforce consistency |
02:16:45 | * | beholders_eye quit (Read error: Connection reset by peer) |
02:22:22 | * | beholders_eye joined #nim |
02:50:40 | FromDiscord | <saiplayz1138> do you guys know of any browser made in Nim? |
03:02:16 | * | beholders_eye quit (Read error: Connection reset by peer) |
03:08:22 | * | beholders_eye joined #nim |
03:30:43 | * | lucasta quit (Quit: Leaving) |
03:42:10 | * | beholders_eye quit (Read error: Connection reset by peer) |
03:46:20 | * | krux02 quit (Remote host closed the connection) |
03:48:16 | * | beholders_eye joined #nim |
03:49:48 | * | beholders_eye quit (Read error: Connection reset by peer) |
03:55:38 | * | beholders_eye joined #nim |
03:56:27 | * | beholders_eye quit (Read error: Connection reset by peer) |
04:01:58 | * | beholders_eye joined #nim |
04:15:59 | * | SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev) |
04:20:19 | * | SchweinDeBurg joined #nim |
04:20:19 | * | beholders_eye quit (Read error: Connection reset by peer) |
04:26:43 | * | beholders_eye joined #nim |
04:28:06 | * | beholders_eye quit (Read error: Connection reset by peer) |
04:34:04 | * | beholders_eye joined #nim |
05:03:23 | FromDiscord | <threefour> Web browser? |
05:27:46 | FromDiscord | <saiplayz1138> In reply to @threefour "Web browser?": yea |
05:41:08 | FromDiscord | <Phil> No.↵However, that's in part because web browsers are basically multi-billion-dollar projects and nobody is investing that kind of money |
05:47:27 | FromDiscord | <saiplayz1138> In reply to @isofruit "No. However, that's in": I'm going to make one, its not gonna be the prettiest one but it'll work |
05:48:58 | FromDiscord | <Phil> In that case best of luck to you, particularly with getting the JS runtime down as well as all the event hooks, HTML to view rendering, when to do repaints and implementing everything according to spec. |
05:49:27 | FromDiscord | <Phil> As well as implementing the entire CSS spec |
06:03:34 | FromDiscord | <saiplayz1138> isn't there a WebView thing for Nim already |
06:07:04 | FromDiscord | <Phil> Ahh, you plan on circumventing implementing your own JS, HTML and CSS engines by using the pre-installed webview? |
06:07:43 | FromDiscord | <Phil> Sure, that could work, though that'll mean for e.g. linux that you're using the engines of less supported browsers such as e.g. Epiphany under the hood |
06:09:06 | FromDiscord | <ElegantBeef> In reply to @isofruit "Sure, that could work,": Just embed the firefox engine 😄 |
06:09:10 | FromDiscord | <ElegantBeef> "we made a browser" |
06:14:12 | * | ntat joined #nim |
06:19:38 | FromDiscord | <odexine> close enough |
06:22:30 | * | beholders_eye quit (Read error: Connection reset by peer) |
06:23:45 | FromDiscord | <saiplayz1138> In reply to @elegantbeef "Just embed the firefox": or I can rewrite Firefox in Nim to make it faster! :D↵↵its gonna be so easy to do |
06:28:11 | * | beholders_eye joined #nim |
06:31:48 | * | coldfeet joined #nim |
06:38:23 | * | beholders_eye quit (Read error: Connection reset by peer) |
06:44:42 | * | beholders_eye joined #nim |
07:29:10 | * | beholders_eye quit (Read error: Connection reset by peer) |
07:34:46 | * | beholders_eye joined #nim |
07:47:17 | * | Jjp137 quit (Ping timeout: 240 seconds) |
07:47:36 | * | Jjp137 joined #nim |
08:03:52 | * | beholders_eye quit (Read error: Connection reset by peer) |
08:09:35 | * | beholders_eye joined #nim |
08:26:38 | * | beholders_eye quit (Read error: Connection reset by peer) |
08:27:10 | * | beholders_eye joined #nim |
08:41:42 | Amun-Ra | rewriting the codebase is always the best idea (Netscape…;) |
09:17:07 | * | beholders_eye quit (Ping timeout: 255 seconds) |
09:22:02 | * | beholders_eye joined #nim |
09:27:56 | FromDiscord | <s0cketinc> nigger |
09:28:03 | FromDiscord | <s0cketinc> wtf |
09:28:12 | FromDiscord | <s0cketinc> why can we speak nigga in here |
09:28:16 | FromDiscord | <s0cketinc> get automod guys |
09:36:06 | * | beholders_eye quit (Read error: Connection reset by peer) |
09:41:35 | * | beholders_eye joined #nim |
10:06:42 | * | ntat quit (Quit: Leaving) |
10:24:28 | FromDiscord | <odexine> can you actually not do that as a test |
10:24:36 | FromDiscord | <odexine> not sure why you thought that was a good idea |
10:29:51 | * | beholders_eye quit (Read error: Connection reset by peer) |
10:35:43 | * | beholders_eye joined #nim |
10:49:43 | * | coldfeet quit (Remote host closed the connection) |
11:32:22 | * | gst joined #nim |
12:22:26 | FromDiscord | <double_spiral> Is it possible to redefine properties of derived objects? |
12:23:03 | FromDiscord | <double_spiral> sent a code paste, see https://play.nim-lang.org/#pasty=rJTOGVQP |
12:45:15 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=nRzgdVGx |
12:45:46 | FromDiscord | <double_spiral> That works, thank you |
13:08:39 | * | Jjp137 quit (Ping timeout: 268 seconds) |
13:09:00 | * | Jjp137 joined #nim |
13:27:51 | * | krux02 joined #nim |
14:14:08 | NimEventer | New thread by xkonti: 🕹️ Setting up a project with NimForUE [Video], see https://forum.nim-lang.org/t/11735 |
14:24:20 | * | krux02_ joined #nim |
14:26:17 | * | krux02 quit (Ping timeout: 272 seconds) |
14:34:02 | FromDiscord | <ajusa> In reply to @user2m "lol yeah we need": Taggy is the good one, I only forked it into dekao to update some tags and add multi threading support |
15:36:52 | * | gst quit (Ping timeout: 250 seconds) |
15:43:23 | * | hexeme_ quit (Ping timeout: 260 seconds) |
15:44:28 | * | hexeme joined #nim |
16:16:31 | * | beholders_eye quit (Ping timeout: 255 seconds) |
16:20:02 | * | gst joined #nim |
17:16:22 | * | Jhonny2x4 quit (Quit: Jhonny2x4) |
17:19:13 | * | ntat joined #nim |
17:21:33 | * | Jhonny2x4 joined #nim |
17:27:16 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=CxnnyBUu |
17:40:31 | FromDiscord | <demotomohiro> In reply to @graveflo "ik this isn't correct": https://nim-lang.org/docs/system.html#%5B%5D%3D%2Cseq%5BT%5D%2CHSlice%5BU%3A%20Ordinal%2CV%3A%20Ordinal%5D%2CopenArray%5BT%5D↵> If b.len is not exactly the number of elements that are referred to by x, a splice is performed. |
17:41:14 | FromDiscord | <bosinski2023> In reply to @graveflo "ik this isn't correct": no idea why that happens - your assignment seems wrong, but throws no error. Once the slices are identical the b1.len stays unchanged.. |
17:55:07 | * | beholders_eye joined #nim |
17:55:54 | FromDiscord | <odexine> assignment is not wrong |
17:56:03 | FromDiscord | <odexine> idea is "replace spliced part with value" |
17:57:03 | FromDiscord | <odexine> as pseudocode `([0, 1, 2, 3, 4])[1..3] = [6] -> [0, 6, 4]` |
18:00:44 | * | gst quit (Ping timeout: 250 seconds) |
18:01:30 | FromDiscord | <bosinski2023> In reply to @odexine "as pseudocode `([0, 1,": got it, thx, but not too obvious, at least for the uninitiated.. |
18:14:00 | * | gst joined #nim |
18:29:43 | FromDiscord | <odexine> Yeah I don’t blame you for that |
18:42:05 | * | beholders_eye quit (Ping timeout: 240 seconds) |
18:44:07 | FromDiscord | <saiplayz1138> i need some help |
18:44:57 | FromDiscord | <saiplayz1138> i wanna add a way to parse html but im new so i dunno how i would do it. im trying to get specific classes and have them be sent as json |
18:45:14 | FromDiscord | <saiplayz1138> im using httpclient and htmlparser |
18:45:39 | FromDiscord | <saiplayz1138> and im trying to use htmlparser to parse the output of httpclient |
18:59:32 | * | xet7 quit (Quit: Leaving) |
19:09:20 | FromDiscord | <graveflo> In reply to @saiplayz1138 "i wanna add a": there is a json std library too. html and json are different though, so I'm not sure what you are asking |
19:09:59 | FromDiscord | <saiplayz1138> In reply to @graveflo "there is a json": well im using httpclient to fetch websites |
19:10:04 | FromDiscord | <Prestige> Anyone have an idea of how to get the monitor refresh rate (on Linux)? |
19:10:30 | FromDiscord | <saiplayz1138> so what im trying to do is get specific classes from the website with htmlparser |
19:10:47 | FromDiscord | <saiplayz1138> and the json part is for when i put it into a web server |
19:11:07 | FromDiscord | <saiplayz1138> im making a pinned repository api for github |
19:11:40 | FromDiscord | <graveflo> so you want to traverse the html and look for elements with a "class" tag? |
19:12:49 | FromDiscord | <saiplayz1138> In reply to @graveflo "so you want to": basically |
19:13:49 | FromDiscord | <demotomohiro> In reply to @avahe "Anyone have an idea": If you use Xorg, xrandr might print refresh rate. |
19:15:17 | FromDiscord | <Prestige> The only function I'm seeing is `XRRConfigCurrentRate` but it's returing 50 on all the monitors I've tested |
19:15:27 | FromDiscord | <Prestige> 90hz and 165hz monitors |
19:16:27 | * | ntat quit (Quit: Leaving) |
19:22:32 | * | xet7 joined #nim |
19:23:52 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=hAlhIDbE |
19:29:35 | FromDiscord | <graveflo> should prob be 0..<x.len at least |
19:31:48 | * | xet7 quit (Remote host closed the connection) |
19:32:47 | * | xet7 joined #nim |
19:33:51 | * | beholders_eye joined #nim |
19:40:37 | FromDiscord | <demotomohiro> In reply to @avahe "90hz and 165hz monitors": It seems GLFW can get monitor refresh rate:↵https://www.glfw.org/docs/3.3/monitor_guide.html#monitor_modes↵So you use GLFW function or read source code of GLFW and find out how it get the refresh rate. |
19:48:35 | FromDiscord | <saiplayz1138> In reply to @graveflo "I didn't test this": the problem with this is that it doesnt get output from httpclient |
19:49:27 | FromDiscord | <graveflo> can't you just do a "GET" request and then you have the html data? |
20:15:02 | FromDiscord | <saiplayz1138> In reply to @graveflo "I didn't test this": ok so i figure it out |
20:15:28 | FromDiscord | <saiplayz1138> as for the classes, do i put in which exact class i want to find? |
20:16:03 | FromDiscord | <graveflo> do you mean in regards to the example code I posted? |
20:16:12 | FromDiscord | <saiplayz1138> In reply to @graveflo "do you mean in": yep |
20:17:06 | FromDiscord | <graveflo> that will iterate all elements that have a "class" attribute. If you want to test for a specific value of the class attribute you can say something like `ele.attr("class") == "myclass"` |
20:17:28 | FromDiscord | <saiplayz1138> ah alr |
20:18:35 | FromDiscord | <saiplayz1138> so it seems this code isnt working |
20:18:55 | FromDiscord | <saiplayz1138> sent a code paste, see https://play.nim-lang.org/#pasty=vMKkctif |
20:19:38 | FromDiscord | <saiplayz1138> sent a code paste, see https://play.nim-lang.org/#pasty=SCrWzwLe |
20:20:38 | FromDiscord | <graveflo> probably have to check the kind withe `kind()` |
20:21:10 | FromDiscord | <graveflo> I'm guessing that only xnElement may have attributes or something |
20:21:52 | FromDiscord | <saiplayz1138> sent a code paste, see https://play.nim-lang.org/#pasty=xqRRokuw |
20:22:10 | FromDiscord | <saiplayz1138> sent a code paste, see https://play.nim-lang.org/#pasty=RVHdrMFS |
20:22:58 | FromDiscord | <graveflo> did you change `for i in 0..x.len:` to `for i in 0..<x.len:` ? |
20:24:16 | FromDiscord | <graveflo> `<x.len` is correct. I posted it with an error by mistake |
20:24:48 | FromDiscord | <saiplayz1138> let me try |
20:26:09 | FromDiscord | <saiplayz1138> In reply to @graveflo "did you change `for": returned a bunch of "false" |
20:26:28 | FromDiscord | <saiplayz1138> https://media.discordapp.net/attachments/371759389889003532/1249459624034439168/message.txt?ex=66676174&is=66660ff4&hm=a634a0acf5a4b1f178300faaebf2510ad0376cbf1042e3cb57e3d479b02669e2& |
20:27:52 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=PQtlADvq |
20:28:10 | FromDiscord | <saiplayz1138> well |
20:28:23 | FromDiscord | <saiplayz1138> sent a code paste, see https://play.nim-lang.org/#pasty=dhbVgrpy |
20:28:29 | FromDiscord | <saiplayz1138> this is how i did it |
20:28:48 | FromDiscord | <graveflo> so if this is false then it will print false `ele.attr("class") == "pinned-item-list-item"` |
20:29:10 | FromDiscord | <graveflo> try printing this `ele.attr("class")` and see what they are |
20:29:20 | FromDiscord | <saiplayz1138> alright |
20:30:07 | FromDiscord | <saiplayz1138> https://media.discordapp.net/attachments/371759389889003532/1249460538568605848/message.txt?ex=6667624e&is=666610ce&hm=42f086dc8ff0949b934d14fd04a5643f8e25de9d5a791df87110dd6ec5eaf71d& |
20:30:12 | FromDiscord | <saiplayz1138> it actually got the classes this time |
20:31:05 | FromDiscord | <graveflo> and it looks like its in a space deliminator list |
20:31:26 | FromDiscord | <graveflo> like this `mb-3 d-flex flex-content-stretch sortable-button-item pinned-item-list-item js-pinned-item-list-item col-12 col-md-6 col-lg-6` |
20:31:35 | FromDiscord | <saiplayz1138> In reply to @graveflo "and it looks like": i dont want to sound dumb, but since im new to this stuff, what does that mean? |
20:31:41 | FromDiscord | <graveflo> so you have to parse each class for attribute value |
20:31:54 | FromDiscord | <saiplayz1138> hm |
20:32:19 | FromDiscord | <saiplayz1138> let me see |
20:33:00 | FromDiscord | <saiplayz1138> wait |
20:33:12 | FromDiscord | <saiplayz1138> so i have to parse the classes as well? |
20:33:31 | FromDiscord | <graveflo> looks like it. they are prob just separated by spaces |
20:33:33 | FromDiscord | <saiplayz1138> i have to parse the individual element |
20:33:49 | FromDiscord | <saiplayz1138> In reply to @graveflo "looks like it. they": in devtools, they are indeed split up by spaces |
20:34:52 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=kmncWokQ |
20:36:49 | FromDiscord | <saiplayz1138> hm |
20:38:21 | FromDiscord | <saiplayz1138> sent a long message, see https://pasty.ee/bSLJvUJK |
20:38:38 | FromDiscord | <saiplayz1138> ok good so it found the 6 pinned items |
20:38:38 | FromDiscord | <saiplayz1138> cool |
20:39:12 | FromDiscord | <saiplayz1138> thx for the help\ |
20:39:21 | FromDiscord | <graveflo> no prob |
20:40:06 | FromDiscord | <sOkam! 🫐> is there a way to make `std/unittests` stop when finding a failed test that is part of a larger file? |
20:40:42 | FromDiscord | <graveflo> there is a way to make a failure kill the suite I think |
20:42:48 | FromDiscord | <graveflo> maybe the abortOnError thread local? |
20:43:01 | FromDiscord | <double_spiral> Is there a performance difference between an array and an anon tuple of all the same type? |
20:43:36 | FromDiscord | <graveflo> no |
20:44:00 | FromDiscord | <double_spiral> cool |
20:46:30 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=LrUfTIsV |
20:46:37 | FromDiscord | <sOkam! 🫐> Apparently its deprecated... but 🤷♂️ |
20:46:45 | FromDiscord | <sOkam! 🫐> tyty |
20:50:08 | FromDiscord | <ElegantBeef> In reply to @double_spiral "Is there a performance": iirc tuples have no guarantee on packing so the only real difference is that the values might not be contiguous and you cannot runtime index |
20:50:50 | * | lucasta joined #nim |
20:51:15 | FromDiscord | <graveflo> tuple is like a struct, array is like... and array |
20:51:29 | FromDiscord | <double_spiral> an array is an array? that cant be right |
20:51:35 | FromDiscord | <graveflo> im not 100% sure |
20:51:37 | FromDiscord | <ElegantBeef> That's what it says right here |
21:21:07 | FromDiscord | <double_spiral> Do you have to pass an array to a function via reference or is there a better way? |
21:21:43 | FromDiscord | <double_spiral> The function is supposed to handle variable sizes and types |
21:22:02 | FromDiscord | <graveflo> array doesnt pass by reference unless it is a ref or there is optimization at play.. its the same for normal params |
21:22:16 | FromDiscord | <graveflo> if the array is a ref then its always going to be passed like that ofc |
21:23:03 | FromDiscord | <graveflo> it doesnt have to be mutable. You can explicitly pass a ref. you can use openArray, but you cant control the actualy stack frame much if the arrays length > 3 address sizes I think |
21:23:17 | FromDiscord | <graveflo> (edit) "actualy" => "actual" |
21:23:28 | FromDiscord | <graveflo> (edit) "arrays" => "size in bytes" |
21:23:28 | FromDiscord | <double_spiral> gotcha |
21:24:48 | FromDiscord | <graveflo> oh and a var is going to be a pass by reference too, I think. again unless some optimization decides to do two copy operations instead of an indirection |
21:46:11 | FromDiscord | <saiplayz1138> @graveflo i need a little bit of help again |
21:48:52 | FromDiscord | <saiplayz1138> what i need help with is trying to collect the stuff into a map |
21:59:20 | FromDiscord | <graveflo> nim has std/tables for map-like structures |
22:00:10 | FromDiscord | <saiplayz1138> oh |
22:00:22 | FromDiscord | <saiplayz1138> oh yeah these |
22:00:31 | FromDiscord | <saiplayz1138> but im having a hard time understanding how they work |
22:00:44 | FromDiscord | <saiplayz1138> is it meant to be a let or var? |
22:01:34 | FromDiscord | <graveflo> I think the table is not a value type so that wont matter. You probably want to use `newTable()` |
22:01:44 | FromDiscord | <saiplayz1138> In reply to @graveflo "I think the table": oh ok |
22:02:05 | FromDiscord | <double_spiral> is there an inbuilt function for replacing all the items in an array with something? |
22:02:15 | FromDiscord | <graveflo> sequtil |
22:02:24 | FromDiscord | <double_spiral> yeah but whats the function called |
22:02:28 | FromDiscord | <saiplayz1138> In reply to @graveflo "I think the table": https://nim-lang.org/docs/tables.html#newTable |
22:02:32 | FromDiscord | <saiplayz1138> this one right? |
22:02:41 | FromDiscord | <double_spiral> the docs arent very good ngl |
22:03:25 | FromDiscord | <graveflo> In reply to @saiplayz1138 "https://nim-lang.org/docs/tables.html#newTable": yea |
22:03:43 | FromDiscord | <graveflo> In reply to @double_spiral "the docs arent very": idk I don't do much sugary stuff in nim but maybe `applyIt` would work |
22:04:17 | FromDiscord | <graveflo> https://nim-lang.org/docs/sequtils.html#applyIt.t%2Cuntyped%2Cuntyped |
22:04:30 | FromDiscord | <Robyn [She/Her]> In reply to @graveflo "I think the table": There's a `Table` which is a value type and there's `TableRef` which isn't a reference type |
22:05:35 | FromDiscord | <Robyn [She/Her]> `newTable` initialises a TableRef and `initTable` initialises a `Table` |
22:06:52 | FromDiscord | <graveflo> makes sense. I like to think of tables as refs so I use `newTable` when I can |
22:11:36 | FromDiscord | <saiplayz1138> i still cant figure them out |
22:12:01 | FromDiscord | <saiplayz1138> sent a code paste, see https://play.nim-lang.org/#pasty=XxCpYKOQ |
22:13:24 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=FmbjxnqE |
22:13:35 | FromDiscord | <graveflo> what you have is a literal. Which is fine but you don't have to do it like that |
22:13:50 | FromDiscord | <saiplayz1138> sent a code paste, see https://play.nim-lang.org/#pasty=UYzXrGDQ |
22:14:10 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=aTzEqHHx |
22:14:18 | FromDiscord | <saiplayz1138> for my case, I'm trying to find a users pinned repositories, so I'll have to look for other classes right? |
22:14:30 | FromDiscord | <saiplayz1138> in order fill out the table |
22:15:04 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=qFxlnkIx |
22:15:56 | FromDiscord | <graveflo> In reply to @saiplayz1138 "for my case, I'm": I'm not sure that the html structure is, but you can use iterators / functions similar to the other ones that I posted along with the data structures in the std library to build your logic |
22:22:18 | FromDiscord | <saiplayz1138> sent a code paste, see https://play.nim-lang.org/#pasty=hcUtEtgQ |
22:22:26 | FromDiscord | <saiplayz1138> (edit) "https://play.nim-lang.org/#pasty=saxZuWFO" => "https://play.nim-lang.org/#pasty=bBpmwfes" |
22:23:18 | FromDiscord | <graveflo> this expression `ele.attr("class").containsClass("pinned-item-list-item")` is a boolean. so that would be like saying:↵`t.add(true)`↵tables work on key value pairs so that is prob not right |
22:23:50 | FromDiscord | <saiplayz1138> oh |
22:24:16 | FromDiscord | <saiplayz1138> so all that does is just tell if its true or not |
22:24:23 | FromDiscord | <saiplayz1138> it doesnt actually collect data |
22:24:41 | FromDiscord | <graveflo> the data is in the ele |
22:24:56 | FromDiscord | <graveflo> so that will get you to a place where you know the ele has the class you want |
22:26:27 | FromDiscord | <graveflo> like if you pass this if statement `if ele.attr("class").containsClass("pinned-item-list-item")` then you know the ele is one that you are looking for... provided that you are looking for elements that have `pinned-item-list-item` in their class attribute |
22:26:48 | FromDiscord | <saiplayz1138> hm, now lets say i want to find |
22:27:01 | FromDiscord | <saiplayz1138> pinned-item-desc |
22:27:12 | FromDiscord | <saiplayz1138> in the pinned-item-list class |
22:27:58 | FromDiscord | <saiplayz1138> the element seems to be an a class within the li element (where the pinned-item-list-item) is located |
22:29:04 | FromDiscord | <graveflo> its a great exercise to take some logic and move it into a `proc` so that it can be used more generally. You can modify the code we had before so that a `proc` accepts an XlmNode and a class string. it can return a `seq[XmlNode]` that contains all matching elements. Or you can make an iterator that yields them |
22:29:11 | FromDiscord | <graveflo> but it would be done in much the same way |
22:29:16 | FromDiscord | <saiplayz1138> wait a minute, i found a class that has everything |
22:29:21 | FromDiscord | <saiplayz1138> which is `pinned-item-list-item-content` |
22:29:27 | FromDiscord | <graveflo> or that |
22:29:56 | FromDiscord | <saiplayz1138> In reply to @saiplayz1138 "which is `pinned-item-list-item-content`": and is also a class |
22:30:00 | FromDiscord | <saiplayz1138> so |
22:30:03 | FromDiscord | <saiplayz1138> using that |
22:30:12 | FromDiscord | <saiplayz1138> why dont i just extract any info from that class? |
22:30:22 | FromDiscord | <graveflo> whatever works for you |
22:30:43 | FromDiscord | <saiplayz1138> whatever's simpler i guess |
22:31:01 | FromDiscord | <saiplayz1138> https://clickette.net/u/vivaldi_nJC95hDIyo.png |
22:31:22 | FromDiscord | <saiplayz1138> this is what i see when i select that element |
22:31:50 | FromDiscord | <saiplayz1138> In reply to @graveflo "its a great exercise": would it be easier to do the first thing or the second thing? |
22:32:21 | FromDiscord | <graveflo> they are both easy. The first thing is better if you think you will re-use the concept. Otherwise it makes no difference |
22:37:57 | FromDiscord | <saiplayz1138> In reply to @graveflo "they are both easy.": i probably will reuse it |
22:43:08 | * | Guest59 joined #nim |
22:43:19 | Guest59 | Hello |
22:43:25 | Guest59 | How are you? |
22:43:48 | FromDiscord | <saiplayz1138> sent a code paste, see https://play.nim-lang.org/#pasty=HKXnVFyd |
22:43:52 | FromDiscord | <saiplayz1138> this is what i came up with |
22:44:01 | FromDiscord | <saiplayz1138> but im not 100% sure if this is correct |
22:44:12 | * | Guest59 quit (Client Quit) |
22:47:15 | FromDiscord | <graveflo> In reply to @saiplayz1138 "i probably will reuse": I think that it might be missing something |
22:47:40 | FromDiscord | <saiplayz1138> what is it missing? |
22:49:01 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=fNiLhCXY |
22:49:58 | FromDiscord | <saiplayz1138> In reply to @graveflo "add something like this:": so im going to have to make that proc right? |
22:50:07 | FromDiscord | <graveflo> yea |
22:50:12 | FromDiscord | <saiplayz1138> alr |
22:54:18 | FromDiscord | <saiplayz1138> In reply to @graveflo "add something like this:": wait |
22:54:30 | FromDiscord | <saiplayz1138> wouldnt this just be the iterator we made earlier? |
22:55:59 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=JatgVzWV |
22:58:12 | FromDiscord | <saiplayz1138> In reply to @graveflo "its pretty close. It": what would be different? |
22:59:33 | FromDiscord | <graveflo> nothing really. you can just write the loops explicitly. if you want something that finds only the relevant nodes then `"pinned-item-list-item"` wouldn't be hard coded |
22:59:47 | FromDiscord | <saiplayz1138> sent a code paste, see https://play.nim-lang.org/#pasty=YFyLSLJt |
23:00:10 | FromDiscord | <saiplayz1138> type mismatch: got 'XmlNode' for 'sub' but expected 'seq[XmlNode]' |
23:00:51 | FromDiscord | <saiplayz1138> ofc the problem's obvious |
23:01:12 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=RVoVHLSU |
23:01:26 | FromDiscord | <saiplayz1138> In reply to @graveflo "im guessing you want": yep |
23:01:54 | FromDiscord | <saiplayz1138> but i also want it to be able to get the info for the description |
23:02:34 | FromDiscord | <saiplayz1138> so lets say the description of the repo is "hello world"↵↵the end result would be "description": "hello world" |
23:03:34 | FromDiscord | <saiplayz1138> I'm basically trying to make this but in Nim:↵↵https://pinned.thrzl.xyz/xytrux |
23:04:07 | FromDiscord | <saiplayz1138> sent a code paste, see https://play.nim-lang.org/#pasty=AMQYoqFL |
23:04:26 | FromDiscord | <saiplayz1138> you get what I mean? |
23:08:29 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=zGxfTniG |
23:12:57 | FromDiscord | <saiplayz1138> In reply to @graveflo "ok so from what": i guess so |
23:13:04 | FromDiscord | <saiplayz1138> thanks for your help |
23:55:31 | * | beholders_eye quit (Ping timeout: 255 seconds) |