--- Log opened Fri Jun 24 00:00:36 2016 |
00:34 | | crystalclaw is now known as crystalclaw|AFK |
00:45 | | Derakon[AFK] is now known as Derakon |
01:28 | | himi [sjjf@Nightstar-dm0.2ni.203.150.IP] has joined #code |
01:28 | | mode/#code [+o himi] by ChanServ |
01:36 | | Shady [ShadyGuru@Nightstar-qfckjl.tv13.ptd.net] has quit [[NS] Quit: Yay, he's gone] |
01:37 | | Shady [ShadyGuru@Nightstar-qfckjl.tv13.ptd.net] has joined #code |
01:48 | | gizmore [kvirc@Nightstar-281bka.dip0.t-ipconnect.de] has joined #code |
02:32 | | gizmore|2 [kvirc@Nightstar-281bka.dip0.t-ipconnect.de] has joined #code |
02:32 | | gizmore|2 [kvirc@Nightstar-281bka.dip0.t-ipconnect.de] has quit [[NS] Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/] |
02:35 | | gizmore [kvirc@Nightstar-281bka.dip0.t-ipconnect.de] has quit [Ping timeout: 121 seconds] |
03:24 | | crystalclaw|AFK is now known as crystalclaw |
04:34 | | catadroid` [catadroid@Nightstar-0njnc8.dab.02.net] has joined #code |
04:36 | | catadroid [catadroid@Nightstar-m77iba.dab.02.net] has quit [Ping timeout: 121 seconds] |
05:13 | | Derakon is now known as Derakon[AFK] |
05:58 | | VirusJTG_ [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code |
06:01 | | VirusJTG [VirusJTG@Nightstar-055.kas.104.208.IP] has quit [Ping timeout: 121 seconds] |
06:16 | | crystalclaw is now known as crystalclaw|AFK |
06:44 | | Shady [ShadyGuru@Nightstar-qfckjl.tv13.ptd.net] has quit [[NS] Quit: Yay, he's gone] |
07:39 | | Kindamoody[zZz] is now known as Kindamoody |
07:55 | | celticminstrel [celticminst@Nightstar-80kfip.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
08:37 | | Emmy [NSkiwiirc@Nightstar-41pbej.static.chello.nl] has joined #code |
08:37 | | mode/#code [+o Emmy] by ChanServ |
08:46 | | himi [sjjf@Nightstar-dm0.2ni.203.150.IP] has quit [Ping timeout: 121 seconds] |
08:57 | <@Emmy> | 0.0 Oh. Now there's a small miracle |
08:57 | <@Emmy> | here i am, looking for a method to implement dragging a file into a hyperlink field in access |
08:57 | <@Emmy> | and it turns out that this is already a thing that works |
08:58 | <@Emmy> | Now if only it didn't create relative paths. |
09:14 | <@Emmy> | heh. it kinda stirs my ego when i'm viewed as the go-to person for complicated questions at the company. :D |
09:17 | < catadroid`> | I enjoy that feeling too |
09:17 | | catadroid` is now known as catadroid |
09:18 | <@Emmy> | regardless of if i'm actually capable of solving the issue, it's still fun. |
10:37 | | * catadroid nods |
10:41 | | VirusJTG_ [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Leaving] |
10:41 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code |
10:41 | | mode/#code [+ao VirusJTG VirusJTG] by ChanServ |
11:02 | | Reiv [NSwebIRC@Nightstar-m7rd21.xtra.co.nz] has joined #code |
11:02 | | mode/#code [+o Reiv] by ChanServ |
11:04 | | catadroid` [catadroid@Nightstar-qrl9sh.dab.02.net] has joined #code |
11:06 | | catadroid [catadroid@Nightstar-0njnc8.dab.02.net] has quit [Ping timeout: 121 seconds] |
11:15 | | himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code |
11:15 | | mode/#code [+o himi] by ChanServ |
11:21 | | Kindamoody is now known as Kindamoody|afk |
11:47 | | Emmy [NSkiwiirc@Nightstar-41pbej.static.chello.nl] has quit [[NS] Quit: http://www.kiwiirc.com/ - A hand crafted IRC client] |
12:15 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection reset by peer] |
13:30 | | Emmy [M@Nightstar-9p7hb1.direct-adsl.nl] has joined #code |
13:30 | | mode/#code [+o Emmy] by ChanServ |
13:47 | <@ErikMesoy> | Python: How do I best take a YourNameHere string , which contains zero or more instances of %s, and a Name string, and do (YourNameHere % Name) the appropriate amount of times, then return the result? |
13:48 | <@ErikMesoy> | Simply doing (YourNameHere % Name) errors if YourNameHere does not contain exactly one %s. What's the equivalent of "for each %s, do %Name" ? |
13:48 | <@ErikMesoy> | I have a function sketched but it looks incredibly hairy. |
13:57 | <@abudhabi> | You could write a function that takes the template string and the argument, then checks if the template contains %s, and either substitutes the payload or just returns the original template string. |
13:58 | <@abudhabi> | fun(template,payload) { if (template.contains("%s") return template.format(payload); else return template; } |
13:58 | <@abudhabi> | Apply appropriate python to this pseudocode. |
13:58 | <@ErikMesoy> | That is pretty much what I've written, except I inlined format() and it is hairy. |
14:00 | <@ErikMesoy> | "Hi %s, welcome to %s Hall" % "Bob" is an error. "Hi %s, welcome to %s Hall" % ("Bob", "Bob") is correct and I don't see the clean way of constructing the ("Bob", "Bob") for formatting. |
14:09 | <@pjdelport> | ErikMesoy: That sounds like an XY Problem. What do you actually want to do? |
14:11 | <@ErikMesoy> | pjdelport: Well, basically the part with inserting Name in a YourNameHere string the appropriate amount of times in a non-terribly-hairy way. I'm not attached to %s, but {} seems to have similar trouble. |
14:11 | <@pjdelport> | The general answer would be to parse the template to determine the number of slots, but that doesn't necessarily solve your original problem. |
14:11 | <@pjdelport> | Yes, but why, and for what? |
14:12 | <@pjdelport> | Especially if it's not specific to the % syntax; that changes the problem substantially. |
14:12 | <@ErikMesoy> | In order to be able to use generic message strings and name strings so that I can describe events that happen without having to tell each object "This is how you talk about yourself". |
14:12 | <@pjdelport> | (Are you familiar with the XY Problem phenomenon?) |
14:12 | <@ErikMesoy> | (Yes) |
14:12 | | celticminstrel [celticminst@Nightstar-80kfip.dsl.bell.ca] has joined #code |
14:12 | | mode/#code [+o celticminstrel] by ChanServ |
14:12 | <@pjdelport> | Oh. So just named arguments, then? |
14:13 | <@ErikMesoy> | I'm not sure what you mean by that, but it sounds right. |
14:13 | <@pjdelport> | >>> 'Hello {name}. I had a pet named {name}.'.format(name='foo') |
14:13 | <@pjdelport> | 'Hello foo. I had a pet named foo.' |
14:13 | <@ErikMesoy> | Wait, I thought I tried that and it errored. |
14:13 | <@ErikMesoy> | Lemme poke at this. |
14:14 | <@pjdelport> | If this is for a game, you might want a fuller template rendering language? |
14:15 | <@ErikMesoy> | Aha. I was using literal {} which requires format(name, name, name) repeated the correct number of times. {name} just takes format(Name). |
14:18 | <@ErikMesoy> | For the record of future generations: "{0} and more {0}".format("spam") --> "spam and more spam", this is the occurences-invariant version I can now use. But I had had "{} and more {}".format("spam") --> error. (And ditto error with %s) |
14:29 | <@pjdelport> | Yes, you need named or numbered items to refer to an item more than once. |
14:30 | <@pjdelport> | The {} is just a shortcut for {0}, {1}, etc. |
14:30 | <@pjdelport> | (it was added later) |
14:58 | | Emmy [M@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds] |
15:57 | | catadroid` [catadroid@Nightstar-qrl9sh.dab.02.net] has quit [Ping timeout: 121 seconds] |
17:06 | | Derakon[AFK] is now known as Derakon |
17:10 | | Netsplit Kakrafoon.Nightstar.Net <-> Krikkit.Nightstar.Net quits: @PinkFreud |
17:27 | | Shady [ShadyGuru@Nightstar-qfckjl.tv13.ptd.net] has joined #code |
17:50 | | Netsplit over, joins: @PinkFreud |
17:51 | | Shady is now known as NSGuest19928 |
17:54 | | NSGuest19928 is now known as Shady |
17:57 | | ErikMesoy [Erik@Nightstar-hq72t5.customer.cdi.no] has quit [Connection reset by peer] |
17:57 | | ErikMesoy [Erik@Nightstar-hq72t5.customer.cdi.no] has joined #code |
18:31 | | mode/#code [+o ErikMesoy] by ChanServ |
19:27 | | Kindamoody|afk is now known as Kindamoody |
20:50 | | catadroid [catadroid@Nightstar-r2rf88.dab.02.net] has joined #code |
20:54 | | Kindamoody is now known as Kindamoody[zZz] |
21:15 | | catadroid` [catadroid@Nightstar-r2rf88.dab.02.net] has joined #code |
21:18 | | catadroid [catadroid@Nightstar-r2rf88.dab.02.net] has quit [Ping timeout: 121 seconds] |
21:28 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
21:28 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
23:50 | | kourbou [uid114955@Nightstar-u0buu4.irccloud.com] has joined #code |
--- Log closed Sat Jun 25 00:00:52 2016 |