--- Log opened Tue Sep 09 00:00:41 2014 |
00:15 | | Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds] |
01:05 | <@Azash> | https://imgur.com/bd8QeIV |
01:51 | | RchrdB [0x2ba22e11@Nightstar-qe9.aug.187.81.IP] has quit [[NS] Quit: Leaving] |
01:59 | | Turaiel[Offline] is now known as Turaiel |
02:45 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down] |
03:16 | | Kindamoody[zZz] is now known as Kindamoody |
04:27 | | Netsplit *.net <-> *.split quits: Xon, @gnolam, @macdjord |
04:31 | | mode/#code [+o Reiv] by ChanServ |
04:31 | | Netsplit over, joins: gnolam |
04:31 | | mode/#code [+o gnolam] by ChanServ |
04:32 | | Netsplit over, joins: macdjord |
04:32 | | mode/#code [+o macdjord] by ChanServ |
04:34 | | Xon [Xon@Nightstar-j72.ku7.252.119.IP] has joined #code |
04:54 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving] |
05:54 | | Turaiel is now known as Turaiel[Offline] |
05:59 | | macdjord is now known as macdjord|slep |
06:00 | | celticminstrel [celticminst@Nightstar-ak6p6n.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
06:22 | | Kindamoody is now known as Kindamoody|out |
08:18 | | * McMartin unrips the Cybernoid II soundtrack, gets it back into runnable program form, \m/s |
08:35 | | Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code |
08:35 | | mode/#code [+o Checkmate] by ChanServ |
09:34 | | theSmith [theSmith@Nightstar-jsk.dsv.156.80.IP] has joined #code |
09:35 | < theSmith> | hi #code |
09:37 | < theSmith> | so.. i have a decoupling problem. I'm writing a network manager which has a communication thread for every TCP connection. Every thread constantly tries to receive data. When a specific message is received via TCP, a method should be called (GUI refresh). I dont want to access the gui directly, so i want to create some sort of interface behaviour. I found this article http://waa.ai/4VKw and i think the described "Way 3" is what i want. If we |
09:37 | < theSmith> | look on the example from the article, my Threads would be Class "A" and should be calling a class "B" (GUI) method via an Adaptor. But i have no idea how to design the Adaptor to get this work. What do you think? ( very sorry for this long Message :/ ) |
09:37 | < theSmith> | any suggestions? |
10:15 | | AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has joined #code |
10:19 | | RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has joined #code |
10:19 | | mode/#code [+o RchrdB] by ChanServ |
10:29 | <@gnolam> | theSmith: look into event-driven programming. |
10:29 | <@gnolam> | ISTR Wikipedia having some decent examples. |
10:38 | | AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has quit [[NS] Quit: Leaving] |
10:43 | | RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has quit [Ping timeout: 121 seconds] |
10:43 | < theSmith> | ah okay. I guess the right way is to pass a event to my adaptor class and from there to my GUI... |
10:45 | | RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has joined #code |
10:45 | | mode/#code [+o RchrdB] by ChanServ |
11:20 | | thalass [thalass@Nightstar-5gtf3h.bigpond.net.au] has joined #code |
11:20 | | mode/#code [+o thalass] by ChanServ |
11:47 | | thalass is now known as Thalass|codey |
11:55 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code |
12:04 | | Orthia [orthianz@Nightstar-4bn.db2.224.119.IP] has quit [Ping timeout: 121 seconds] |
12:09 | | Orthia [orthianz@Nightstar-mjgi3l.callplus.net.nz] has joined #code |
12:09 | | mode/#code [+o Orthia] by ChanServ |
12:12 | | theSmith [theSmith@Nightstar-jsk.dsv.156.80.IP] has quit [Connection reset by peer] |
14:02 | | Thalass|codey is now known as Thalass|gamey |
14:41 | | * TheWatcher eyes this "bug" report for one of his Mediawiki plugins |
14:41 | <@TheWatcher> | ... why would anyone still be using 1.22.6 |
14:42 | <@TheWatcher> | seriously, wtf. |
14:45 | <@RchrdB> | How old is that? |
14:45 | <@TheWatcher> | Just about 6 months |
14:46 | <@TheWatcher> | 1.22.x is the legacy branch, currently on 1.22.10 |
14:46 | <@RchrdB> | Are there known security problems that it should be updated for? |
14:46 | <@TheWatcher> | Yep |
14:46 | <@RchrdB> | 6 months isn't very long. |
14:47 | <@RchrdB> | *6 months isn't very long for a functional upgrade that might break stuff. Not so much for updating to dodge vulns. |
14:48 | <@TheWatcher> | Yeah, there have been 3 security releases since then |
16:08 | | Orthia [orthianz@Nightstar-mjgi3l.callplus.net.nz] has quit [Ping timeout: 121 seconds] |
17:06 | | celticminstrel [celticminst@Nightstar-ak6p6n.dsl.bell.ca] has joined #code |
17:06 | | mode/#code [+o celticminstrel] by ChanServ |
17:18 | | VirusJTG_ [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code |
17:22 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [Ping timeout: 121 seconds] |
17:39 | <&jeroud> | Step one in debugging stuff is to install the latest release. |
19:42 | | Kindamoody|out is now known as Kindamoody |
20:05 | | RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has quit [[NS] Quit: Leaving] |
20:08 | | Kindamoody is now known as Kindamoody[zZz] |
20:55 | <@TheWatcher> | And the problem this time is that I'm calling a function that was only added in 1.23 anyway |
20:56 | | RchrdB [0x2ba22e11@Nightstar-qe9.aug.187.81.IP] has joined #code |
20:56 | | mode/#code [+o RchrdB] by ChanServ |
20:57 | <@TheWatcher> | So now I need to either tell him he's SOL, or work out how to make it work with 1.22; I'm heavily leaning to the former, because legacywoe |
21:01 | <@gnolam> | FINALLY |
21:02 | <@gnolam> | With that remote upgrade finally completed, I can finally get off work. At 22:00. |
21:08 | <@TheWatcher> | -_- |
21:08 | <@TheWatcher> | I hope you get overtime :/ |
21:09 | | Turaiel[Offline] is now known as Turaiel |
21:14 | | Orthia [orthianz@Nightstar-4bn.db2.224.119.IP] has joined #code |
21:14 | | mode/#code [+o Orthia] by ChanServ |
21:40 | | * TheWatcher pokes at the 1.22 code, tries to work out if this is even possible there |
22:05 | | Turaiel is now known as Turaiel[Offline] |
23:29 | | Harlow [harlow@Nightstar-jh0kti.wireless.uic.edu] has joined #code |
23:32 | < Harlow> | does anyone know how to get the reference of an variable in a structure? |
23:33 | < Harlow> | (C lanugage) |
23:33 | <&McMartin> | The address, you mean? C doesn't have references. |
23:33 | <&McMartin> | &foo.bar |
23:33 | < Harlow> | well address |
23:33 | < Harlow> | really. |
23:33 | < Harlow> | ok |
23:34 | <&McMartin> | Not to be confused with (&foo)->bar |
23:34 | < Harlow> | witch would be nothing right? |
23:35 | <&McMartin> | Which would be identical to foo.bar |
23:35 | <&McMartin> | if foo is itself a pointer, &foo->bar should also be a pointer to bar proper, but it's probably clearer to write &(foo->bar) |
23:37 | < [R]> | Is getting the address of a member invalid C? Or am I getting confused with really old C? |
23:37 | < Harlow> | it might be |
23:38 | < Harlow> | it would explain why I'm having such an ordeal with this |
23:38 | < Harlow> | http://pastebin.com/c3jXbt8L |
23:38 | < Harlow> | line 28 would be impossible if c doesn't allow the address of a member. |
23:39 | < Harlow> | as it is now line 28 still won't work even with the advice Mcmartin gave, so it might be C. |
23:39 | < Harlow> | (C thats causing the problem that is.) |
23:39 | < [R]> | Uhh |
23:39 | < [R]> | No, that's perfectly valid even if you couldn't get the address of a member. |
23:40 | <&McMartin> | C allows the addresses of members. |
23:41 | < Harlow> | so am i doing something wrong on line 28, i mean segfaults are caused by improper allocation yes? |
23:41 | <&McMartin> | But that's not even what you're doing |
23:41 | <&McMartin> | Your error is on line 27 |
23:41 | <&McMartin> | You're freeing a random garbage value |
23:42 | < [R]> | You do have a bug: you increment size by 1, but expect it to be increased by the undefined sizeToGrow earlier. |
23:42 | <&McMartin> | In fact, you should be detonating on line 24 |
23:42 | <&McMartin> | pst->size could be literally anything |
23:42 | < [R]> | That too, you never initiate the struct |
23:44 | <&McMartin> | And even if you did, I don't believe that free(NULL) is legal. |
23:45 | < [R]> | Heh, I remember some idiot was told that C doesn't give default values to anything, so the data in them is "random", idiot then assumes that reading from unassigned variables would be a suitable replacement for a PRNG. |
23:45 | < Harlow> | http://pastebin.com/tdE1swzR |
23:45 | < Harlow> | so you're saying that should work, minus the whole free(NULL) thing. |
23:45 | < [R]> | [...] Otherwise, or if free(ptr) has already been called before, undefined behavior occurs. If ptr is NULL, no operation is performed. |
23:46 | < Harlow> | ok so free(ptr) when ptr is null is no big deal. |
23:46 | < [R]> | &pst->arr=temp;//Point the old array at the adress of the new array. <-- that's incorrect now |
23:46 | < [R]> | You don't need the & |
23:47 | < Harlow> | if its just pst->arr=temp; there are segfaults |
23:47 | < [R]> | You still never initialize prt->arr anyways |
23:47 | < [R]> | Also that shouldn't even compile |
23:48 | < [R]> | st1->size = 0; |
23:48 | < [R]> | st1->top = 0; |
23:48 | < [R]> | Wrong access operator, should be using . instead of -> |
23:48 | < Harlow> | well yeah the includes are all missing |
23:48 | < [R]> | Not what I meant |
23:53 | < [R]> | https://gist.github.com/RobinStamer/37e80a4c682205affda4 |
23:53 | < [R]> | That compiles and does not segfault |
23:55 | < Harlow> | [R]: can you explain why that is valid, (Line 47) pst->arr=temp; |
23:56 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code |
23:56 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
23:56 | < Harlow> | temp is a pointer to an array of chars, pst->arr should be just an accessed array no? |
23:56 | < [R]> | No |
23:57 | < [R]> | pst->arr is type char * |
23:57 | <&ToxicFrog> | Harlow: temp and pst->arr both have type char*, so they're type-compatible. |
23:57 | < [R]> | temp is type char & |
23:57 | < [R]> | temp is type char * |
23:57 | <&ToxicFrog> | What he's doing there is freeing the memory originally pointed to by pst->arr so that it doesn't leak, and then reassigning pst->arr to point to the same memory that temp points to. |
23:57 | < [R]> | You don't need to do any dereferencing if they're the same type. |
23:58 | < Harlow> | does temp* get released when the function is done or because its a pointer the program Would forget about it, except we still have its handle with st1.arr? |
23:58 | < [R]> | Fixed it so it shows a bit more, and it doesn't crap out when malloc fails |
23:58 | < [R]> | No |
23:59 | < [R]> | You reserved memory with malloc(), it's not freed until you call free() |
--- Log closed Wed Sep 10 00:00:51 2014 |