--- Log opened Fri Mar 21 00:00:48 2014 |
00:01 | | Thalasleep is now known as Thalass |
00:02 | | mode/#code [+o Thalass] by ChanServ |
00:18 | | Reiver is now known as Orth |
00:43 | | Derakon[AFK] is now known as Derakon |
01:31 | | HotShot_ [HotShot@Nightstar-v7se27.try.wideopenwest.com] has joined #code |
01:46 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down] |
01:47 | | HotShot_ [HotShot@Nightstar-v7se27.try.wideopenwest.com] has quit [Ping timeout: 121 seconds] |
02:24 | | HotShot_ [HotShot@Nightstar-pcem1v.sfldmi.sbcglobal.net] has joined #code |
02:26 | | HotShot [theeaznon@Nightstar-pcem1v.sfldmi.sbcglobal.net] has joined #code |
02:27 | | HotShot_ [HotShot@Nightstar-pcem1v.sfldmi.sbcglobal.net] has quit [[NS] Quit: Leaving] |
03:01 | | Thalass [thalass@Nightstar-bk3u2d.bigpond.net.au] has quit [Ping timeout: 121 seconds] |
03:57 | | HotShot [theeaznon@Nightstar-pcem1v.sfldmi.sbcglobal.net] has quit [[NS] Quit: Trespassers will be shot, Survivers will be shot again! [Time wasted on Mirc 1day 1hr 50secs]] |
04:00 | | Derakon is now known as Derakon[AFK] |
04:54 | | macdjord [macdjord@Nightstar-c0i1dq.cable.rogers.com] has quit [[NS] Quit: "Too long have night and day warred, their false dichotomy plaguing this land. No more. I come now to put them both down, to usher in a new era of balance and peace. For now is the time of... /Twilight/. *And the Dusk shall Reign Eternal.*"] |
05:05 | | macdjord [macdjord@Nightstar-c0i1dq.cable.rogers.com] has joined #code |
05:05 | | mode/#code [+o macdjord] by ChanServ |
05:06 | | Kindamoody[zZz] is now known as Kindamoody |
05:17 | | RchrdB [RichyB@Nightstar-c6u.vd5.170.83.IP] has quit [[NS] Quit: Gone.] |
05:21 | | RichyB [RichyB@Nightstar-c6u.vd5.170.83.IP] has joined #code |
05:22 | | RichyB is now known as NSGuest7294 |
05:53 | | ErikMesoy|sleep is now known as ErikMesoy |
06:01 | | celticminstrel [celticminst@Nightstar-mhtogh.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.] |
06:44 | | AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has joined #code |
07:02 | | Red_Queen [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code |
07:02 | | mode/#code [+o Red_Queen] by ChanServ |
07:11 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code |
07:11 | | mode/#code [+o himi] by ChanServ |
07:13 | | Erik [8f610223@Nightstar-qtq4f2.mibbit.com] has joined #code |
07:26 | | Kindamoody is now known as Kindamoody|out |
07:50 | | AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has quit [[NS] Quit: Leaving] |
08:12 | | You're now known as TheWatcher |
09:30 | < Erik> | Trivium: http://giantcursor.com/ |
09:42 | | Syka [the@Nightstar-gcr.tk7.127.1.IP] has joined #code |
09:43 | | Syka is now known as NSGuest16349 |
09:55 | | NSGuest16349 is now known as Syk |
10:44 | <@Red_Queen> | Doesn't even work when you actually click it. I am dissappoint. |
10:57 | <@TheWatcher> | From the javascript it should "alert('Son of a bitch, you clicked me!'); |
10:57 | <@TheWatcher> | " |
10:59 | <@TheWatcher> | But it looks like image used for the cursor screws up getting clicks to the div |
11:00 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code |
11:30 | < NSGuest7294> | TheWatcher, I like your choice of strings. |
11:30 | < NSGuest7294> | hmm, I need to beat my znc setup with a stick |
11:30 | | NSGuest7294 is now known as RchrdB |
11:31 | | mode/#code [+o RchrdB] by ChanServ |
11:39 | | RchrdB [RichyB@Nightstar-c6u.vd5.170.83.IP] has quit [[NS] Quit: Gone.] |
11:40 | | RichyB [RichyB@Nightstar-c6u.vd5.170.83.IP] has joined #code |
11:40 | | RichyB [RichyB@Nightstar-c6u.vd5.170.83.IP] has quit [Connection closed] |
11:41 | | RchrdB [RichardB@Nightstar-c6u.vd5.170.83.IP] has joined #code |
11:41 | | mode/#code [+o RchrdB] by ChanServ |
12:28 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed] |
12:58 | < HearingEarDog> | Hmm. Processor-motherboard compatibility is mostly the oscket, right? |
12:59 | < HearingEarDog> | *socket |
13:01 | < HearingEarDog> | I have this motherboard, the Intel i945P, and I want to find the best compatible processor. |
14:20 | | Syk [the@Nightstar-gcr.tk7.127.1.IP] has quit [Ping timeout: 121 seconds] |
14:32 | | Erik [8f610223@Nightstar-qtq4f2.mibbit.com] has quit [[NS] Quit: http://www.mibbit.com ajax IRC Client] |
17:24 | | HotShot [HotShot@Nightstar-v7se27.try.wideopenwest.com] has joined #code |
17:46 | | HotShot [HotShot@Nightstar-v7se27.try.wideopenwest.com] has quit [Connection closed] |
18:20 | | celticminstrel [celticminst@Nightstar-mhtogh.dsl.bell.ca] has joined #code |
18:20 | | mode/#code [+o celticminstrel] by ChanServ |
18:23 | | celticminstrel [celticminst@Nightstar-mhtogh.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.] |
18:23 | | celticminstrel [celticminst@Nightstar-mhtogh.dsl.bell.ca] has joined #code |
18:23 | | mode/#code [+o celticminstrel] by ChanServ |
18:25 | | celticminstrel [celticminst@Nightstar-mhtogh.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.] |
18:35 | | HotShot^Work [HotShot^Wor@Nightstar-v7se27.try.wideopenwest.com] has joined #code |
19:16 | | HotShot^Work [HotShot^Wor@Nightstar-v7se27.try.wideopenwest.com] has quit [Connection closed] |
20:03 | | Derakon [chriswei@Nightstar-5fqf0m.ca.comcast.net] has joined #code |
20:03 | | mode/#code [+ao Derakon Derakon] by ChanServ |
20:03 | | * Derakon hoorays sarcastically at this device. |
20:03 | <&Derakon> | Same one I was working on last Friday. |
20:03 | <&Derakon> | It's working! |
20:03 | <&Derakon> | However, if I ever call free() then it crashes. |
20:04 | <&Derakon> | Also, I'm setting the display pixels for a B&W display, effectively, aye? |
20:04 | <&Derakon> | So I have a bit buffer where the bit state indicates if the corresponding pixels is on or off... |
20:04 | <&Derakon> | The ordering of the bits is wrong twice. |
20:05 | <&Derakon> | Which is to say, I have the data arranged as 4 bytes in little-endian order, but each byte internally is big-endian, right? |
20:05 | <&Derakon> | And the actual required order is big-endian bytes where the individual bits are little-endian! |
20:05 | <@Tamber> | ...oh dear. |
20:06 | <&Derakon> | (IOW if you have a 32-bit number whose bytes are ABCD, and D is, say, 10101001, then I have to rearrange it to DCBA and change D to 10010101) |
20:06 | <&Derakon> | (And do similar reordering of the other three bytes) |
20:07 | <&Derakon> | Anyway, that's just me ranting. |
20:08 | <&Derakon> | I now have a somewhat related problem. Say I have an array whose values can be between 0 and 3. |
20:08 | <&Derakon> | I want to output 3 arrays. In all 3, where there's a 0 in the original, there should be a 0 in the array; ditto for 3s. |
20:08 | <&Derakon> | Er. |
20:09 | <&Derakon> | Where there's a 3, there should be a 1 in the output array, always. |
20:09 | <&Derakon> | Where there's a 1 in the input, there should be a 1 in only one of the output arrays. |
20:09 | <&Derakon> | Where there's a 2 in the input, there should be a 1 in two of the input arrays. |
20:09 | <&Derakon> | Basically we're doing timewise dithering to get multiple levels of grayscale, by flipping between these arrays rapidly. |
20:10 | <&Derakon> | With 3 colors it's easy...with more, I want to evenly-space the 1s and 0s. |
20:10 | <&Derakon> | I feel certain there must be a convenient algorithm for this, but I can't think of it. |
20:12 | <&Derakon> | Something like this, basically: http://pastebin.com/t845YWTk |
20:12 | <@Azash> | Derakon: That bit ordering system is bewildering |
20:12 | <&Derakon> | I know, right? |
20:15 | <&Derakon> | No ideas on the dithering algorithm? |
20:17 | <@Azash> | Not from me, sorry |
20:20 | <@macdjord> | Derakon: Are the output arrays 0-intialized? |
20:21 | <&Derakon> | Mac: 1-initialized as it happens, since the display also inverts when imaged, but that's basically the same thing. |
20:25 | <&Derakon> | Hmm... |
20:25 | <&Derakon> | I guess I could do a rolling summation of some kind. |
20:26 | <&Derakon> | That is, for e.g. the case where, say, 2 out of 8 buffers should be "on" -- we add .25 to that pixel in each iteration; when it meets or exceeds 1, we write a 1 in the output, subtract 1 from the summation, and continue. |
20:26 | <&Derakon> | I think that should work. |
20:27 | <@macdjord> | Derakon: I'd consider a random algorithm, actually. |
20:29 | <@macdjord> | for (int i = 0; i < array_width; i++) { |
20:29 | <@macdjord> | for (int j = 0; j < num_output_arrays; j++) { |
20:29 | <@macdjord> | output_arrays[j][i] = (randint(num_output_arrays) < input_array[i]); |
20:29 | <@macdjord> | } |
20:29 | <@macdjord> | } |
20:29 | <&Derakon> | Mm, problem there being that we're going to generate these arrays precisely once. |
20:30 | <&Derakon> | If randomness results in a "bad" dithering then we're stuck with it until we notice and re-generate. |
20:30 | <&Derakon> | It is an easy solution though, I grant that. :) |
20:31 | <@macdjord> | Yeah, but the human eye is /really good/ at seeing patterns. If all the dithered pixels of the same intensity flicker on the same sequence, it's likely to be visible. |
20:31 | <@macdjord> | Ah! Mix the two. Fixed sequence, but the starting point in that sequence is randomized. |
20:31 | <&Derakon> | This isn't intended for human-eye fooling; it's indended for mediating light dose rates in photon-activated proteins. |
20:31 | <@macdjord> | Oh. |
20:32 | <&Derakon> | I think the summation-buffer approach works nicely though. |
20:32 | | * macdjord nods |
20:32 | <@macdjord> | I'd do it with ints, rather than floats, but yeah. |
20:33 | <&Derakon> | Behold: http://pastebin.com/P78QAs4j |
20:36 | <@macdjord> | Derakon: ... I can't actually follow what's going on there. |
20:41 | <@macdjord> | Derakon: You don't seem to /use/ 'i' anywhere in 'for i in indicies'. |
20:42 | <&Derakon> | Hm, so I don't. |
20:42 | <&Derakon> | I'm guessing you aren't familiar with numpy arrays. |
20:43 | <&Derakon> | Numpy arrays allow you to adjust multiple values at the same time. For example, if foo is a length-10 numpy array of zeros, then I can do "foo[1,4,7] = 1" and have an array [0,1,0,0,1,0,0,1,0,0]. |
20:43 | <&Derakon> | numpy.where() generates the indices of the array where a boolean conditional is met. |
20:44 | <&Derakon> | So we start with summationBuffer being 0 throughout. |
20:44 | <&Derakon> | Then each pass through the main loop, we add values to summationBuffer, based on the values in data. |
20:44 | <&Derakon> | Say we have 9 colors; where data is 1, we add 1/8th; where data is 2, we add 1/4th; etc. |
20:45 | <&Derakon> | Where data is 8, we add 1. |
20:45 | <&Derakon> | Then we say "A pixel is on if its value in summationBuffer >= 1". |
20:45 | <&Derakon> | And then we subtract 1 from summationBuffer where it's >= 1. |
20:46 | <&Derakon> | Effectively, summationBuffer is an accumulator that tracks how close each pixel is to being on. And pixels with higher values (i.e. higher frequencies) increase more quickly and thus are on more often. |
20:48 | <@macdjord> | Derakon: Is there a numpy operation that adds two arrays? I.e. can you do 'summationBuffer += data', and have each element of summationBuffer be increades by the value of the corresponding element in data? |
20:49 | <&Derakon> | ...I could, yes. |
20:49 | <&Derakon> | And eliminate some dividing, at the cost of not triggering on summationBuffer >= 1 (instead using summationBuffer >= NUM_COLORS) |
20:50 | <&Derakon> | It'd also mean not having to recalculate the addends each time though. Handy, that. |
20:51 | <&Derakon> | Mm, I don't have to do that anyway. |
20:52 | <&Derakon> | Just precalculate a fixed buffer that gets added each cycle. Meh, floating-point ops are cheap. |
20:53 | <@macdjord> | temp = numpy.ones((data.shape), dtype = numpy.uint8) |
20:53 | <@macdjord> | summationBuffer += data |
20:53 | <@macdjord> | onIndices = numpy.where(summationBuffer >= NUM_COLORS - 1) |
20:53 | <@macdjord> | temp[onIndices] = 0 |
20:53 | <@macdjord> | summationBuffer[onIndices] -= NUM_COLORS - 1 |
20:53 | <@macdjord> | # Collapse to a linear array. |
20:53 | <@macdjord> | temp.shape = numpy.product(temp.shape) |
20:53 | <@macdjord> | handle.write(numpy.packbits(temp)) |
20:54 | <&Derakon> | Yeah, I implemented a similar version; thanks for the suggestion. |
20:54 | <&Derakon> | I'm leaving the threshold at 1, while recognizing that the choice of threshold value is arbitrary, just because this is easier for non-coders to understand. |
20:55 | <@macdjord> | Er? I don't understand. Can you show me the new version? |
20:55 | <&Derakon> | http://pastebin.com/HNKbY3gy |
21:00 | <@macdjord> | It wasn't the cost of the float operations I was trying to avoid but the inaccuracy. If you have, say, 4 light levels, then a pizel of value '1' might end up having summation values '0.33333', '0.66666', '0.99999' - thus it never triggers, even though it should. |
21:00 | <&Derakon> | Hm, that is a point. |
21:01 | <&Derakon> | This does seem to be working, mind, but it's worth bearing in mind. |
21:01 | <@macdjord> | It also eliminates the need for the addend entirely, since you can just add the original data. |
21:01 | <&Derakon> | Yes, I know. |
21:02 | <@Namegduf> | This feels less like a puzzle and more like the backstory to someone in the future, possibly yourself, seeing that something is *adding* colour and wondering what is going on. |
21:04 | <@macdjord> | Namegduf: Well, the reference to 'colour' is erronious; it's actually just greyscale. |
21:04 | <&Derakon> | Hey, gray is a color! |
21:05 | <@macdjord> | Derakon: Yes, but I wouldn't call different shades thereof /different/ colours. So 'MAX_COLORS' is misleading. |
21:05 | | Kindamoody|out is now known as Kindamoody |
21:07 | <&Derakon> | Ehh, not too worried since anyone working with this code will know the device in question is inherently black-and-white. |
21:09 | <@macdjord> | Ture, but compare the effort nnow of doing a s/MAX_COLORS/MAX_SHADES/g vs. some future person spending a minute going 'Colours? WTF was this guy trying to do?' |
21:09 | <&Derakon> | Okay, "shades" is a better term, yeah. |
21:11 | <@macdjord> | Derakon: http://thecodelesscode.com/case/84 |
21:13 | <&Derakon> | Careful, you're so sharp you might poke your eye out. :p |
21:16 | | macdjord is now known as macdjord|dogwalk |
21:22 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
21:22 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
21:33 | | Kindamoody is now known as Kindamoody[zZz] |
22:19 | | Derakon [chriswei@Nightstar-5fqf0m.ca.comcast.net] has quit [[NS] Quit: leaving] |
22:23 | | macdjord|dogwalk is now known as macdjord |
23:33 | | ErikMesoy is now known as ErikMesoy|sleep |
--- Log closed Sat Mar 22 00:00:04 2014 |