Open Side Menu Go to the Top

06-03-2012 , 12:00 AM
I've had Kaspersky for a few years but I didnt know it was Russian or that it was so badass.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
06-04-2012 , 12:41 PM
Okay so Im still in C# and I have a small problem with events again. I have a main class, CApp, where everything happens in the program. In there I make an instance of a ClassA that, among other things, waits for something to happen and raises an event when that something happens. In CApp I also have about 8 instances that are all derived from a virtual base class ClassB, and they all need to subscribe to ClassA's event. But I dont want ClassB to know about ClassA or the other way around, and I would like to just do the event with the base class of ClassB instead of doing it 8 times. What should I do?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-04-2012 , 02:12 PM
Quote:
Originally Posted by Ryanb9
Okay so Im still in C# and I have a small problem with events again. I have a main class, CApp, where everything happens in the program. In there I make an instance of a ClassA that, among other things, waits for something to happen and raises an event when that something happens. In CApp I also have about 8 instances that are all derived from a virtual base class ClassB, and they all need to subscribe to ClassA's event. But I dont want ClassB to know about ClassA or the other way around,
What is "know about"?

In order for B to subscribe to an event from A, a delegate from B has to make it into A's list of subscribers. You can introduce a switchboard class C if you like, but somebody must have references to the instances of A and B.


Quote:
and I would like to just do the event with the base class of ClassB instead of doing it 8 times. What should I do?
What is "just do the event"?

You can put the event handler and subscription logic in the base class. Have the base class event handler call a virtual function to let the derived classes do something.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-04-2012 , 07:09 PM
Quote:
Originally Posted by Chips Ahoy
You can put the event handler and subscription logic in the base class. Have the base class event handler call a virtual function to let the derived classes do something.
yeah this is what im doing now but I guess its the best way.

Quote:
Originally Posted by Chips Ahoy
What is "know about"?
I mean instead of using CApp as a go-between. But I guess thats really the only option. Unless... public static event?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-04-2012 , 08:15 PM
Quote:
Originally Posted by Ryanb9
I mean instead of using CApp as a go-between. But I guess thats really the only option. Unless... public static event?
public static event doesn't make sense. Events come from somewhere. I don't see what problem you are trying to solve.

CApp doesn't have to do the subscribing. CApp did the creation of A and the Bs so it makes sense to play matchmaker. It can pass references to the Bs to A, or it can pass references to the A to the Bs.

If you want to minimize the coupling between A and the Bs then use interfaces.
An interface is a minimal but specific contract that a class implements. I often use different files (dlls) as a barrier to minimize visibility. Then I have a set of common interfaces that everybody references.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2012 , 04:36 AM
Quote:
Originally Posted by Chips Ahoy
public static event doesn't make sense. Events come from somewhere. I don't see what problem you are trying to solve.

CApp doesn't have to do the subscribing. CApp did the creation of A and the Bs so it makes sense to play matchmaker. It can pass references to the Bs to A, or it can pass references to the A to the Bs.

If you want to minimize the coupling between A and the Bs then use interfaces.
An interface is a minimal but specific contract that a class implements. I often use different files (dlls) as a barrier to minimize visibility. Then I have a set of common interfaces that everybody references.
I guess it does make sense for it to play matchmaker but there are just a lot of matches going on and its getting a little crowded. Also ... havnt used an interface yet, I will try that thanks.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2012 , 05:16 AM
Computer thingies are really good at doing lots of things quickly, she'll be right.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2012 , 06:58 AM
WTF does a yellowtitle mean, never seen that before.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2012 , 08:52 AM
^^ doppleganger
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2012 , 12:34 PM
it's because mat peed on him during the hackpocalypse 2012 recovery.

Last edited by tyler_cracker; 06-05-2012 at 12:34 PM. Reason: true story!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2012 , 01:35 PM
Quote:
Originally Posted by tyler_cracker
it's because mat peed on him during the hackpocalypse 2012 recovery.
LDO
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2012 , 05:33 PM
http://msdn.microsoft.com/en-us/hh500769

http://blogs.msdn.com/b/jasonz/archi...-2012-ctp.aspx

Microsoft has a beta of "Roslyn" -- a project that exposes the insides of their (C#, vb.net) development tools. IDE, compiler, symbols, ...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2012 , 07:00 AM
Quote:
Originally Posted by Ryanb9
Okay so Im still in C# and I have a small problem with events again. I have a main class, CApp, where everything happens in the program. In there I make an instance of a ClassA that, among other things, waits for something to happen and raises an event when that something happens. In CApp I also have about 8 instances that are all derived from a virtual base class ClassB, and they all need to subscribe to ClassA's event. But I dont want ClassB to know about ClassA or the other way around, and I would like to just do the event with the base class of ClassB instead of doing it 8 times. What should I do?
I don't think you can completely decouple them, but you can make them depend on a single interface. The way you word it makes me think that you have ClassB doing the work of subscribing. Instead, I'd pass a classB object to the classA object and the classA object does with it what it needs. Derive classB from a NotifiableInterface class that classA knows about with a notify() virtual function that you can implement in classB. classA and classB only know about the interface. See the observer pattern for a more detailed discussion.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2012 , 07:14 AM
Trying to package up a project of mine into (for my own use only) libraries and feeling a bit lost. Say I have libA and libB both of which depend on libC. libC is quite large and is only used for a small amount of the functionality in libA and libB. libA and libB change independently and also could be used independently, but sometimes they will be used in the same application. If they are both static libraries and depend on the static libC, then I will have two copies of the libC code in any application that uses both libA and libB, correct? libA and libB are mission critical and I have integration tests that test the end result. They take quite a long time and I'd like libB and libC to be shipped as complete packages so they are guaranteed tested when used. This has created an aversion to using libC as a dynamic library (though this does seem hugely paranoid as this library is not a standard library and I'm not sure how I could possibly use a different version of libC, ignoring how unlikely the chance that a new version would break libA and libB). Am I being paranoid? Any words of advice? What if my library dependency tree is much larger (and includes several "root" libraries that are used across most others)? I don't have any cyclic dependencies though and the "root" libraries are generally quite stable.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2012 , 08:58 AM
6.5m LinkedIn password hashes leaked:
http://news.ycombinator.com/item?id=4073309

Looks like they were unsalted and not iteratively hashed (unconfirmed), which is a pretty dismal failure
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2012 , 12:59 PM
Quote:
Originally Posted by skier_5
If they are both static libraries and depend on the static libC, then I will have two copies of the libC code in any application that uses both libA and libB, correct?
No. Static libraries don't contain the other static libraries they depend on. To verify: put a unique string in libC and grep for it in libA and libB with strings http://technet.microsoft.com/en-us/s.../bb897439.aspx

It won't appear in A or B, and only once in the binary.

The linker starts with a list of object files. For each object file it looks at the symbols the file provides, and the symbols the file needs. After it checks them all, there will be some symbols that are needed but not provided within the binary.

So the linker starts searching libraries for each unknown symbol. As soon as it finds a library that provides the symbol, it quits searching. That library is added to the binary if it wasn't already, and its symbols get added to both the provides and needs lists. If it's a dll, the linker just creates import table entries to let the loader finish the job.

If your object files don't use any symbols from a library, it doesn't ever get added to the binary.

So you see there's only one libC. When the linker is working on libA, it pulls in libC to satisfy A. Then when the linker works on libB, the needed symbols are already there.

Quote:
libA and libB are mission critical and I have integration tests that test the end result. They take quite a long time and I'd like libB and libC to be shipped as complete packages so they are guaranteed tested when used.
bolded should be A and B, yes?

Quote:
Any words of advice?
hmmm. If you really want an exact set of things packaged together, the best way is to package them yourself. Build a dll with a matched set of libraries. I'm not sure this is what you really want. You can use linker tricks to get a similar result.

Consider a symbol in C that automatically changes during the build process and depends on the version number. Now have A and B reference that symbol. They will only link with the exact version of C they were tested against.

Quote:
This has created an aversion to using libC as a dynamic library (though this does seem hugely paranoid as this library is not a standard library and I'm not sure how I could possibly use a different version of libC, ignoring how unlikely the chance that a new version would break libA and libB).
You already have the problem you are hoping to avoid because of this:

Quote:
libA and libB change independently and also could be used independently, but sometimes they will be used in the same application.
You only get one libC linked in, but A and B could be tested against different versions of libC. Whichever libC is in the search path / library list first comes in and has to satisfy both A and B.

Quote:
What if my library dependency tree is much larger (and includes several "root" libraries that are used across most others)? I don't have any cyclic dependencies though and the "root" libraries are generally quite stable.
How about putting a binary boundary around anything that can change independently -- the end products? So if libA and libB are things people consume, make them into dllA and dllB. Static link all of their dependencies into them. You say you want to ship them as complete packages, a single dll without dependencies is a complete package.

It is known that compiler settings need to be pretty uniform when working with static libraries to prevent the multiple / conflicting crt problem. That relaxes a bit when you go to dlls as long as you don't alloc/free across boundaries. Less requirements on the users of A/B is a good thing.

This is all from old memories, so please do sanity check what I say.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2012 , 05:37 PM
IPv6...weeee?!?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2012 , 12:11 AM
i'm sure most of you have seen this but a Just In Case PSA:

http://www.pcworld.com/printable/art...printable.html

change your linkedin password!

(and developers: SALT YOUR MOTHER****ING HASHES!!!!!!!)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2012 , 02:05 PM
Last.fm been hacked too: http://www.bbc.co.uk/news/technology-18358485

Juk
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2012 , 02:45 PM
bcrypt bcrypt bcrypt bcrypt
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2012 , 10:58 PM
Well, the Flame virus just took an interesting turn. Flame authors order infected computers to remove all traces of the malware.

Quote:
Flame has a built-in feature called SUICIDE that can be used to uninstall the malware from infected computers. However, late last week, Flame's creators decided to distribute a different self-removal module to infected computers that connected to servers still under their control, Symantec's security response team said in a blog post.
...
"It locates every [Flame] file on disk, removes it, and subsequently overwrites the disk with random characters to prevent anyone from obtaining information about the infection," the Symantec researchers said. "This component contains a routine to generate random characters to use in the overwriting operation. It tries to leave no traces of the infection behind."
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2012 , 11:05 AM
If all of the sudden random stuff is written to disk that's a trace, right?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2012 , 12:03 PM
If you are watching the disk for random changes, sure. But if you go to a machine that had the virus and it had wiped itself, all of the files would be gone and their locations on the disk would be overwritten.

I guess finding random blocks that don't look like the remanents of well know filetype might be a sign, but I wouldn't call it conclusive.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-09-2012 , 11:44 PM
hi i am new to this forum. i am an amaetur programmer. just finished this project i was writing through my python command line to gather data from a googledoc spreadshet and put that data into an sqlite database. i am pretty happy with myself was able to finish the very first part now i have a populated table with 21 rows and 6 columns of data. how long would that you guys like 1/2 an hour is this really simple program?

also what is a good resource for me to get a good understanding of programming? right now i can fumble my way through programming by copying sample programs online but i have no understanding of the fundementals like what is a server, an api, a library, etc...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-10-2012 , 12:24 AM
Quote:
Originally Posted by unluckyboy
how long would that you guys like 1/2 an hour is this really simple program?
what does this mean? But yes anything done in 30 min is a simple program imo, if that is what you are asking.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m