code logs -> 2017 -> Sat, 21 Jan 2017< code.20170120.log - code.20170122.log >
--- Log opened Sat Jan 21 00:00:05 2017
00:43 himi [sjjf@Nightstar-vk1v2u.optusnet.com.au] has joined #code
00:43 mode/#code [+o himi] by ChanServ
00:47 himi [sjjf@Nightstar-vk1v2u.optusnet.com.au] has quit [Ping timeout: 121 seconds]
00:48 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code
01:59
<&[R]>
C question: memory leaks cannot occur once a process is killed/ended correct? IE: a memory leak can only exist while a process is actually mishandingling memory.
02:00
< catalyst>
Once the process has ended, the OS ought to reclaim the memory from it
02:00
< catalyst>
So it'll only persist if it was allocating a resource that the OS or another process manages
02:28 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
02:29 mode/#code [+qo Vornicus Vornicus] by ChanServ
03:25
<@celticminstrel>
I changed the batch file a little and now call is exiting with -1...
03:26
<@celticminstrel>
It seems to do everything it's supposed to despite this, but the -1 exit code makes MSVC complain.
03:26 himi [sjjf@Nightstar-0bu.81f.90.202.IP] has joined #code
03:26 mode/#code [+o himi] by ChanServ
03:33 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has quit [[NS] Quit: Leaving]
03:39 catadroid [catalyst@Nightstar-823s6k.dab.02.net] has joined #code
03:41 himi [sjjf@Nightstar-0bu.81f.90.202.IP] has quit [Connection reset by peer]
04:33
<@celticminstrel>
I have a variable $i which contains eg 0. I need to use that variable to reference variables of the form $var_0, $var1, etc. Is this possible in bash?
04:34
<@celticminstrel>
(If I were writing this myself I'd use an array, but sadly the variables are already set and I just want to loop over them.)
04:40
<@celticminstrel>
Cursory googling hints at "eval"...
04:58 crystalclaw [crystalclaw@Nightstar-12q9ui.xyz] has quit [Connection closed]
04:58 crystalclaw [crystalclaw@Nightstar-12q9ui.xyz] has joined #code
04:58 mode/#code [+o crystalclaw] by ChanServ
05:01 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
05:04 Vash [Vash@Nightstar-uhn82m.ct.comcast.net] has quit [[NS] Quit: Quit]
05:22 crystalclaw_ [crystalclaw@Nightstar-12q9ui.xyz] has joined #code
05:22 crystalclaw [crystalclaw@Nightstar-12q9ui.xyz] has quit [Connection closed]
06:18 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
06:18 mode/#code [+qo Vornicus Vornicus] by ChanServ
07:09 celticminstrel [celticminst@Nightstar-h4m24u.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
07:14 catadroid` [catalyst@Nightstar-edd2hs.dab.02.net] has joined #code
07:16 catadroid [catalyst@Nightstar-823s6k.dab.02.net] has quit [Ping timeout: 121 seconds]
--- Log opened Sat Jan 21 09:36:14 2017
09:36 TheWatcher [chris@GlobalOperator.Nightstar.Net] has joined #code
09:36 Irssi: #code: Total of 32 nicks [29 ops, 0 halfops, 0 voices, 3 normal]
09:36 mode/#code [+o TheWatcher] by ChanServ
09:37 Irssi: Join to #code was synced in 56 secs
10:45 himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code
10:45 mode/#code [+o himi] by ChanServ
10:56 Kindamoody[zZz] is now known as Kindamoody
11:23 Kindamoody is now known as Kindamoody|afk
13:30 gnolam_ [lenin@Nightstar-t1tbf0.cust.bahnhof.se] has joined #code
13:32 gnolam [lenin@Nightstar-t1tbf0.cust.bahnhof.se] has quit [Ping timeout: 121 seconds]
13:37 gnolam_ is now known as gnolam
13:37 mode/#code [+o gnolam] by ChanServ
13:44 catadroid` [catalyst@Nightstar-am3oe1.dab.02.net] has joined #code
13:46 catadroid [catalyst@Nightstar-edd2hs.dab.02.net] has quit [Ping timeout: 121 seconds]
14:53 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code
15:35 Kindamoody|afk is now known as Kindamoody
15:42 celticminstrel [celticminst@Nightstar-h4m24u.dsl.bell.ca] has joined #code
15:42 mode/#code [+o celticminstrel] by ChanServ
18:53 catadroid [catalyst@Nightstar-am3oe1.dab.02.net] has joined #code
18:53 catadroid` [catalyst@Nightstar-am3oe1.dab.02.net] has quit [The TLS connection was non-properly terminated.]
19:53
<@celticminstrel>
I thought "$FILE" was supposed to force it to be passed as a single parameter even if it contains spaces... but that doesn't seem to be working...
20:04
<&ToxicFrog>
celticminstrel: it will, but if you're doing stuff with (say) eval, or ssh, there may be multiple layers of quote stripping.
20:04
<&ToxicFrog>
Paste the code.
20:05
<&ToxicFrog>
also, instead of using eval, use !:
20:06
<&ToxicFrog>
[ben@thoth:~]$ var0="zero"; var1="one"; var2="two"; index=1; ptr="var${index}"; echo "${!ptr}"
20:06
<&ToxicFrog>
one
20:08
<@celticminstrel>
Just for the record, this is separate from the eval thing, which I already worked out.
20:08
<@celticminstrel>
grep -i 'something' "$FILE"
20:08
<@celticminstrel>
is giving errors related to spaces in file paths.
20:08
<@celticminstrel>
In my git pre-commit hook.
20:09
<&ToxicFrog>
Where does $FILE come from, and what exactly are the errors?
20:09
<&ToxicFrog>
Can you pastebin the entire hook?
20:09
<@celticminstrel>
It's a loop variable, and the errors are "no such file or directory" for partial paths.
20:09
<&ToxicFrog>
The problem is in the way you're iterating over the paths in the loop.
20:10
<@celticminstrel>
http://pastebin.com/Yi8daR4A
20:10
<&ToxicFrog>
Are you, perhaps, using `for FILE in $@` rather than `for FILE in "$@"`?
20:10
<@celticminstrel>
Hmm, that could make sense actually.
20:10
<@celticminstrel>
About the problem being in the loop header, I mean.
20:10
<&ToxicFrog>
Ok, yeah, the thing here is, `` (or $(), which you should be using instead) expands to a long string with whitespace in it
20:11
<&ToxicFrog>
"for x in y" splits y on whitespace
20:11
<&ToxicFrog>
*all* whitespace, not just newlines
20:11
<@celticminstrel>
Right.
20:11
<&ToxicFrog>
(this is a vast oversimplicification of globbing/iteration rules, but it gets the point across)
20:11
<&ToxicFrog>
Try instead using something like:
20:12
<&ToxicFrog>
git diff-index .... | cut ... | while read file; do ...stuff with file...; done
20:12
<&ToxicFrog>
"read" defaults to reading line-at-a-time.
20:12 * celticminstrel was just reading something that says it should be read -r
20:12
<&ToxicFrog>
Aah. Yes.
20:12
<@celticminstrel>
Okay.
20:12
<&ToxicFrog>
I don't use it often enough to remember that, but it should be.
20:13
<@celticminstrel>
So the pipeline remains the same and then pipes further into while...
20:13
<&ToxicFrog>
You could also do something really quick and dirty, like "git diff-index --cached | grep redacted" just to see if it shows up in the diff anywhere
20:13
<&ToxicFrog>
If you're confident that no existing, committed files have it, and thus any appearance in the diff would mean it's getting added.
20:14 catadroid` [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
20:14
<&ToxicFrog>
Yeah.
20:14
<&ToxicFrog>
'read x' reads a line from stdin into $x; if stdin EOFs, it exits with failure, terminating the loop.
20:14
<@celticminstrel>
Alright, works now. \o/
20:15
<@celticminstrel>
I did end up using eval for the other thing.
20:15
<@celticminstrel>
And even committed it already.
20:15
<&ToxicFrog>
You monster~
20:15
<@celticminstrel>
It works, and I don't feel like changing it now just on principle.
20:16
<@celticminstrel>
That ! is the "history" operator, right?
20:16
<@celticminstrel>
Or does it have a different meaning in substitutions?
20:16 catadroid [catalyst@Nightstar-am3oe1.dab.02.net] has quit [Ping timeout: 121 seconds]
20:29
<&ToxicFrog>
The latter.
20:29
<&ToxicFrog>
${!foo
20:29
<&ToxicFrog>
${!foo} is "evaluate $foo, then use that as a variable name and expand to the contents of that variable"
20:30
<&ToxicFrog>
Its disadvantage over eval is that it's less portable to other shells.
20:30
<&ToxicFrog>
Its advantage is that it doesn't break messily if $foo contains weirdnesses.
20:44 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
20:45 catadroid` [catalyst@Nightstar-45f5qj.dab.02.net] has quit [Ping timeout: 121 seconds]
20:54 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has quit [The TLS connection was non-properly terminated.]
20:54 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
21:05 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has quit [The TLS connection was non-properly terminated.]
21:07 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
21:15 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has quit [The TLS connection was non-properly terminated.]
21:15 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
21:18 catadroid` [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
21:18 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has quit [The TLS connection was non-properly terminated.]
21:22 * McMartin implements the Smoking Clover algorithm.
21:23
<&McMartin>
Either 320x200 is too small a value for an acceptable result or I am implementing this algorithm incorrectly.
21:24
<~Vornicus>
320x200 should be fine.
21:24
<~Vornicus>
what's it doing?
21:25 catadroid` [catalyst@Nightstar-45f5qj.dab.02.net] has quit [The TLS connection was non-properly terminated.]
21:25 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
21:27
<&McMartin>
Producing a graphical result that looks nothing like the images described.
21:27
<&McMartin>
Maybe if I treat it as a much larger area and then clip results to inside the window...
21:28
<&McMartin>
Or rather: "Producing a graphical result that is clearly the correct one given the orders I have given it, but which are clearly not the screenshots shown elsenet for the effect"
21:28
<&McMartin>
That means the English description is oversimplifying.
21:36 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has quit [The TLS connection was non-properly terminated.]
21:36 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
21:46 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has quit [The TLS connection was non-properly terminated.]
21:46 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
21:55
<&McMartin>
OK, I think I've got it.
21:56 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has quit [Connection closed]
21:56 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
22:01
<&McMartin>
You have to graph an octant of x^2+y^2=r^2 with r larger than the screen's largest axis, and you need to do it with a constantly increasing x or y (whichever gives you a continuous line in that octant)
22:01
<&McMartin>
Otherwise you get something that looks more like a moire tunnel than a cloverleaf effect.
22:08 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has quit [The TLS connection was non-properly terminated.]
22:08 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
22:20 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has quit [The TLS connection was non-properly terminated.]
22:20 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
22:33 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has quit [The TLS connection was non-properly terminated.]
22:33 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
22:47 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has quit [The TLS connection was non-properly terminated.]
22:47 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
23:02 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has quit [The TLS connection was non-properly terminated.]
23:02 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
23:12
<&McMartin>
https://hkn.eecs.berkeley.edu/~mcmartin/screenshots/clover_000.png
23:18 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has quit [The TLS connection was non-properly terminated.]
23:18 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
23:37 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has quit [The TLS connection was non-properly terminated.]
23:37 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has joined #code
23:42 catadroid [catalyst@Nightstar-45f5qj.dab.02.net] has quit [Ping timeout: 121 seconds]
--- Log closed Sun Jan 22 00:00:07 2017
code logs -> 2017 -> Sat, 21 Jan 2017< code.20170120.log - code.20170122.log >

[ Latest log file ]