[01:21:57] * Rakko [Rakko!~Rakko@071-082-226-018.res.spectrum.com] has joined the channel. [03:09:57] * Rakko [Rakko!~Rakko@071-082-226-018.res.spectrum.com] has quit (Quit: Leaving). [04:49:02] hah I am having some issues with serialization [04:49:42] I am doing { 1 2 3 } object>bytes foo boa insert-tuple (BLOB) [04:50:27] and select * from foo shows a string (which it shows when I do { 1 2 3 } object>bytes >string too [04:50:35] but they aren't equal [04:50:41] and i have no idea why [04:50:58] the string looks similar, or equal, but the B{ } isn't [04:51:57] I'm not sure how to store { 1 2 3 } in the database other than by using object>bytes and then getting thats stuff and then string>byte-array-fast bytes>object [04:52:10] but it doesnt work :p [04:53:38] so lets see [04:53:48] running the executable prints [04:53:52] "a�p�p�p�" [04:54:05] { 1 2 3 } object>bytes >string prints "aƒpp‚pƒ" [04:54:09] hmm [04:54:15] okay yeah [04:54:50] should I store it as base64 instead or smth? [04:55:12] or what is the recommended/best way to store { 1 2 3 } in an sql database (insert-tuple)? [04:55:51] alternative would be storing "1,2,3" and then doing splitting but that looks too wrong [04:56:02] I just want a list of numbers stored [04:56:20] list of numbers, and a varchar [04:56:33] in a table [04:56:57] alternatively I could modify my schema but bleh [04:57:22] (prob would be the best but still! this got me curious now) [04:58:29] ok so lemme see, okay this is a string with 8 code points [04:58:41] a \x83 p \x81 p \#82 p \x83 [04:59:32] yeah nope [05:06:07] my question still stands:D [05:06:22] but if its a horrible idea then lemme know [05:25:43] wow wow [05:25:46] B{ 97 131 112 129 112 130 112 131 } [05:25:52] executable prints this! [05:25:57] lets see if bytes>object works [05:26:20] the way I'm doing it is probably overkill [05:26:28] and there's a better way [05:26:35] but I'll show you how I'm doing it rn [05:26:37] if it works [05:26:59] "overkill".. or just simply stupid :D [05:27:11] wow [05:27:12] it works [05:27:33] ok so I have "foo" "FOO" UNSIGNED-BIG-INTEGER [05:27:37] and then [05:27:49] { 1 2 3 } object>bytes be> foo boa insert-tuple [05:27:52] and then [05:28:05] "select * from REF" sql-query first string>number 8 >be bytes>object . [05:28:09] and I got { 1 2 3 } back! [05:28:46] but since it's string, might as well use base64? or maybe just not do this at all? xD [05:30:41] I could actually just create another table... [05:31:04] sigh [05:31:20] anyway, if there's a better way for the above code, lemme know [05:31:26] no matter how silly it is :p [05:32:48] (I know about the side-effects of using be>) [05:33:19] and wow, this works with level 2 too [05:37:11] dunno why object>bytes and bytes>object doesn't work though [05:37:17] when I'm using BLOB (or FACTOR-BLOB) [05:37:20] :/ [05:37:26] that would be best I think [05:59:53] ahj [05:59:55] this is better [06:00:00] { 1 2 3 } object>bytes >string [06:00:02] and then [06:00:17] "select * from foo" sql-query first first string>byte-array-fast bytes>object . [06:00:40] now I wonder if it can be improved even further [06:02:28] without >string it says "Dispatching on object: B{ 97 131 112 129 112 130 112 131 } [06:02:31] " [06:02:43] but its udnerstandable [06:03:16] although BLOB is for byte-arrays.. so I'm not sure actually [06:03:19] why it doesnt work [06:03:50] it only works with >string and TEXT [06:04:17] any ideas guys? I'm a newbie [06:05:44] (in case you forgot: I want to "{ 1 2 3 }" in an SQL table (sqlite) [06:05:51] -to [06:06:04] the last way I mentioned works, but surely there's a better way [06:06:20] although I can just re-think the schema, then i don't need to do this [07:44:25] * pounce [pounce!~pounce@ns379743.ip-5-196-70.eu] has quit (Ping timeout: 240 seconds). [07:48:55] * pounce [pounce!~pounce@ns379743.ip-5-196-70.eu] has joined the channel. [07:49:52] * df1scher [df1scher!~df1scher@cpe-23-241-160-2.socal.res.rr.com] has quit (Ping timeout: 265 seconds). [07:50:55] * ephe_meral [ephe_meral!~amnesia@217.9.41.114] has joined the channel. [07:51:22] * Sgeo [Sgeo!~Sgeo@ool-18b982ad.dyn.optonline.net] has quit (Read error: Connection reset by peer). [08:29:30] * ephe_meral [ephe_meral!~amnesia@217.9.41.114] has quit (Ping timeout: 265 seconds). [08:39:08] * ephe_meral [ephe_meral!~amnesia@217.9.41.114] has joined the channel. [10:13:09] ptrkriz: there's a FACTOR-BLOB database type for serialized factor objects. did you try that? [10:16:06] ptrkriz: you can use usage in ./basis/db/tuples/tuples-tests.factor [10:43:28] yeah I did try FACTOR-BLOB but didn't seem to work [10:46:26] I have FACTOR-BLOB now and I insert it using { 1 2 3 } only [10:46:33] "a�p�p�p�" [10:46:37] well I also have a varchar so [10:46:44] sql-query returns { { "a�p�p�p�" "abc" } } [10:47:37] lemme see if "string>byte-array-fast bytes>object ." works [10:48:09] nop [10:48:11] :/ [10:49:27] ptrkriz: can you paste some code somewhere? [10:49:51] { 1 2 3 } object>bytes returns B{ 97 131 112 129 112 130 112 131 } whereas [10:50:02] { 1 2 3 } "abc" ref boa insert-tuple [10:50:05] "select * from REF" sql-query first first string>byte-array-fast . [10:50:10] returns B{ 97 253 112 253 112 253 112 253 } [10:51:00] (which is why I'm using >string because it becomes a string) [10:51:02] alright [10:55:26] sec, I have intellij open and I'm swapping xD [10:55:52] ptrkriz: I just got an example working [10:56:09] ptrkriz: TUPLE: bar data ; [10:56:20] ptrkriz: bar "BAR" { { "data" "DATA" FACTOR-BLOB } } define-persistent [10:56:34] ptrkriz: "a" get [ { 1 2 3 } bar boa insert-tuple ] with-db [10:56:41] ptrkriz: "a" get [ f bar boa select-tuples ] with-db [10:56:47] Where "a" holds the [10:57:13] The last query returns the tuple with { 1 2 3 } in its data slot [10:57:17] hmm what happens if you sql-query? [10:57:27] "select * from whatever" sql-query . [10:58:01] ptrkriz: it probably returns a string of the binary data, because it's not integrated into the automatic marshalling support of define-persistent [10:58:21] ah I see, alright, that's why I got junk then and thought it wasn't working [10:58:24] jeez [10:58:25] thanks [10:58:30] should have used select-tuples [10:59:02] I thought it wasn't working because sql-query didn't print { 1 2 3 } [10:59:28] which I made it print by that code above, but yeah seems like it was unnecessary [10:59:34] Right, the help says it returns each row as an array of string with no type conversions [11:00:17] thank you! [11:00:23] no worries! [11:01:05] * ephe_meral [ephe_meral!~amnesia@217.9.41.114] has quit (Ping timeout: 240 seconds). [11:07:22] * tgunr [tgunr!~davec@dsl-dhcp-conrtxxahre-76-164-103-181.consolidated.net] has joined the channel. [11:36:26] * ephe_meral [ephe_meral!~amnesia@217.9.41.114] has joined the channel. [12:21:53] * TeddyDD [TeddyDD!teddyddmat@gateway/shell/matrix.org/x-gqjdzggvueqwwhem] has quit (Quit: killed). [12:22:19] * zolk3ri[m] [zolk3ri[m]!zolk3rimat@gateway/shell/matrix.org/x-tvzvrydlfntwjjal] has quit (Quit: killed). [12:29:00] * TeddyDD [TeddyDD!teddyddmat@gateway/shell/matrix.org/x-rhgmbllswfuwkbaz] has joined the channel. [14:28:18] * Sgeo [Sgeo!~Sgeo@ool-18b982ad.dyn.optonline.net] has joined the channel. [17:34:23] * ephe_meral [ephe_meral!~amnesia@217.9.41.114] has quit (Ping timeout: 260 seconds). [22:22:11] so... I am using V{ } now and refl. lvl 2 doesn't work >.< I need to check what it strips that I gotta keep (again)... { } works though. [22:23:15] didnt find anything vector related so, ugh alright [22:36:20] ok, it's not anything stripped in stripped-word-props -.- [22:38:31] got it [23:29:12] I have to keep root-cache, vocabs:dictionary, and vocabs:require-hook for V{ } [23:29:15] not sure why tho [23:29:46] what are you attempting? [23:30:06] deploy-tool with reflection level 2 [23:30:46] works as long as I keep those 3 (and prettyprint.config for printing that stuff) [23:30:56] and "slots" [23:31:21] still 26M in all fairness [23:31:43] full env is IIRC ~46 [23:31:59] ah nice comment [23:32:02] ! This file is some hairy shit. [23:32:04] agreed xD [23:32:16] everything is hard-coded :( [23:32:43] ah lvl 1 works too [23:32:58] (still 26M) [23:33:15] but I guess it won't get any better for now [23:33:47] I'm stripping everything that it runs without [23:33:51] I think... [23:34:24] as far as normal shaker.factor goes that is, like I just commented out some bits that I have to keep in order for it to work with level 1-2 [23:35:18] lemme see the diff if I use { } and get rid of those stuff I commented out, I'm curious now [23:35:22] (size) [23:36:48] oh wow [23:36:50] 4.8M [23:37:21] I wonder why I have to keep "root-cache", "vocabs:dictionary", and "vocabs:require-hook" for V{ }