Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

06-17-2012 , 09:36 PM
Quote:
Originally Posted by tyler_cracker
the answer to this question is almost always "no... and yes."
Zen mother****er right there.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-17-2012 , 09:40 PM
Quote:
Originally Posted by jjshabado
I think its suppose to represent a mailbox with the little flag thing up - so new email or something?

Edit: Or maybe you have an unread/unlistened to email,text,voicemail?
Yeah, that's what I thought to start with but managed to test and see what the unread text and voicemail symbols looked like and they were different.

Pretty sure it is a unlocked padlock now (just the icon was so small on this that it was unreadable) and it should hopefully go away when I enter a good signal area.

Juk
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 12:03 AM
In C# I have a main class (Main) that everything is in and another class that is a virtual base class (Base). Assume that in Main I make one instance of each of the four classes that are derived from the aforementioned base class (DerivedN).
Base has an event that Main subscribes to. So each time Derived1 or 2 etc does x Main handles that event. But at the same time, any time Derived1 does the thing that makes it fire the Base event, Derived 4 needs to do something. And anytime Derived2 does the event Derived 3 needs to do something.
I'm wondering if I should go from Derived1 strait to Derived4 or from Derived1 to Main to Derived4.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 12:28 AM
Another angle. It looks kinda different here, like the blue spot in the center of the yellow isn't just a blue spot?

** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 02:20 AM
I work with a whole crapload of Chinese. They can tell me what that image means. Or if they can't, then there's something fishy going on.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 02:27 AM
Quote:
Originally Posted by sdturner02
Another angle. It looks kinda different here, like the blue spot in the center of the yellow isn't just a blue spot?

looks kind of like a radio icon....
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 03:28 AM
Quote:
Originally Posted by Chips Ahoy
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.


bolded should be A and B, yes?


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.



You already have the problem you are hoping to avoid because of this:



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.



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.
Thanks for the response! I actually got sidetracked and have been working on something that hasn't made me confront all this yet, but this has cleared a lot up for me. If I understand correctly, while my static libraries are not including the libraries they depend on, they do include any symbols that they use? So, if I link against my libC first then any symbols that libC uses from libA will be pulled from the libC binary and not from libA?

I'm going to look into the DLL solution and will certainly be exploring this in further depth soon. I already had some issues. I have some classes that are simply referenced in a couple of my libraries and I was getting some very odd behaviour (the program seemed to be skipping a function that was called) using these classes even though the libraries were compiled minutes apart and used the same version of the code. Rearranging the linking order fixed it
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 03:32 AM
Quote:
Originally Posted by Ryanb9
In C# I have a main class (Main) that everything is in and another class that is a virtual base class (Base). Assume that in Main I make one instance of each of the four classes that are derived from the aforementioned base class (DerivedN).
Base has an event that Main subscribes to. So each time Derived1 or 2 etc does x Main handles that event. But at the same time, any time Derived1 does the thing that makes it fire the Base event, Derived 4 needs to do something. And anytime Derived2 does the event Derived 3 needs to do something.
I'm wondering if I should go from Derived1 strait to Derived4 or from Derived1 to Main to Derived4.
That sounds like it's going to get messy real quick. Allow your event class to have multiple listeners and then use multiple inheritance to make any of your derived classes that need to receive an event conform to the listener interface.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 04:30 AM
Since we're all in OO land for today, I have a question:

Given this fun piece of Lisp (Scheme) code:

Code:
(define (append! x y)
  (set-cdr! (last-pair x) y)
  x)

(define (last-pair x)
  (if (null? (cdr x))
      x
      (last-pair (cdr x))))

(define x (list 'a 'b))
(define y (list 'c 'd))
Here's the commented version for those who want to give this one a shot:

Code:
;; Append takes two cons cells (sorta like lists/arrays, 
;;but not really, but lists
;; which are used here allow you to do 
;;cons-cell stuff to it by default)
;; takes the pairs of x and y (pair is really n-items)
;; and appends x to y, 
;;thus ('a 'b 'c) & ('e 'f 'g) => ('a 'b 'c 'd 'e 'f)

;; now create append! which takes two cons x y
;; and appends them together, thus ('a 'b 'c) & ('e 'f 'g) => ('a 'b 'c 'd 'e 'f)
(define (append! x y)
  (set-cdr! (last-pair x) y)
  x)

;; last pair is a helper function to append! 
;;(append is a tail-recursive function)
;; which uses tail recursion to create a single list. 
;; look back up to (append!) and notice 
;;(set-cdr!(....)), which is a procedure
;; that takes the list (in this case) 
;;of x and creates a mutated list.
(define (last-pair x)
  (if (null? (cdr x))
      x
      (last-pair (cdr x))))

;; This of course creates two global variables x and y
(define x (list 'a 'b))
(define y (list 'c 'd))
The output is as follows:

Code:
> (car x)
'a
> (cdr x)
(mcons 'b '())
> (car y)
'c
> (cdr y)
(mcons 'd '())
which all makes sense, and now for plain-ol' append:

Code:
> (define z (append x y))
> z
(mcons 'a (mcons 'b (mcons 'c (mcons 'd '()))))
> (car x)
'a
> (cdr x)
(mcons 'b '())
> (car y)
'c
> (cdr y)
(mcons 'd '())
>
and then append!:

Code:
> (define w (append! x y))
> w
(mcons 'a (mcons 'b (mcons 'c (mcons 'd '()))))
> (car x)
'a
> (cdr x)
(mcons 'b (mcons 'c (mcons 'd '())))
> (car y)
'c
> (cdr y)
(mcons 'd '())
Hopefully you caught the anomaly of (cdr x)

While I understand why this happened (Pen and Paper ftw!), I don't understand why something like this would be needed. Okay, mutable data is obvious, but is there any real-world use where:

-- Create an object
-- Define a new variable w which already has a mutable object x
-- Mutate the object x and store it in w
-- Let mutable and mutated object x hang around freely

I take it the lesson is supposed to be "be wary of mutable data because you may have strange side-effects," but I wonder if there is ever a need to create multiple lines of mutation in a program, or is this strictly a warning to not do this sort of stuff?

One part of the OO programs I have been going through already store the object in the object. For example, one may make create a bank account and have:

(account ('my-account 'withdraw 100))
>> whatever is left provided sufficient funds
and so on and so forth to create further accounts.

But this would be like me asking what the internal x is of procedure account and it telling me that it holds some specified value I can further mutate and this affects all accounts, which isn't supposed to happen. Now that I think of it, this is similar to what I was asking about: account essentially takes a list and creates a mutable cons cell?

Ugh, I feel like this is so close, but there's something there I can't quite explain to myself or articulate, thus I can't really ask the question, but that free-floating mutated and mutable object is bothering me.

note: Part of the stated lesson here is to demonstrate that visually same is not the same as computer same.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 04:57 AM
Quote:
Originally Posted by skier_5
If I understand correctly, while my static libraries are not including the libraries they depend on, they do include any symbols that they use? So, if I link against my libC first then any symbols that libC uses from libA will be pulled from the libC binary and not from libA?
not quite. Each obj gives two lists to the linker: symbols provided, and symbols needed. In the first pass the linker collects both lists for all objs. In the second pass the linker fixes the addresses needed in each obj with the first provider of that symbol (libA is the provider in your example).

Use /Verbose when linking to see what's happening.

Possibly Useful:

1. Add a GetVersion() function to libA
2. Compile libB and libC against libAs that return different values.
3. Link an exe with both libB and libC.
4. call GetVersion from within each lib.
5. See what results you get.

My prediction is both GetVersion() calls return the same value. Which would be a problem. libB.dll & libC.dll is my solution.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 06:25 AM
Quote:
Originally Posted by gaming_mouse
looks kind of like a radio icon....
Yeah could be - Also somebody suggested it looks like a camera too

Quote:
Originally Posted by daveT
I work with a whole crapload of Chinese. They can tell me what that image means. Or if they can't, then there's something fishy going on.
Please ask!

Juk
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 03:09 PM
thanks for help guys i finish my first web scraper now i have a 1500 game database. this program is super ugly looking i had some really ugly solutions to problems but got this big project done!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 07:51 PM
Quote:
Originally Posted by unluckyboy
thanks for help guys i finish my first web scraper now i have a 1500 game database. this program is super ugly looking i had some really ugly solutions to problems but got this big project done!
I have yet to see a scraper that is not ugly... its in their nature.

Congrats
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 08:43 PM
Quote:
Originally Posted by unluckyboy
got this big project done!
lol
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 09:51 PM
why are you laughing at me?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 10:09 PM
i'm guessing: because it is far from a "big" project in the scheme of things.

Last edited by tyler_cracker; 06-18-2012 at 10:09 PM. Reason: "facebook" probably counts as a big project
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 10:47 PM
it is awesome you got it done though, congrats
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 10:52 PM
Quote:
Originally Posted by jukofyork
Yeah could be - Also somebody suggested it looks like a camera too


Please ask!

Juk
The verdict is in: The Chinese are mystified as well. It could be one of two things:

1- Indicator that the phone is unlocked or simply open.
2- Mail box.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-18-2012 , 11:38 PM
how many actual programming courses does the typical CS or CE major take? wondering how far behind I am.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-19-2012 , 01:13 AM
1 or 2 a term I'd guess for most of the degree length, call it 15 or so. I was in a CIS program and had 4 COBOL, a C, C++, VB, CICS, some nonRMDB mainframe database courses in 3 years.

Last edited by kerowo; 06-19-2012 at 01:14 AM. Reason: Gogogogog DeVry!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-19-2012 , 04:10 AM
Quick sqlite question for you guys. Say I have two tables, defined as the following:

Code:
CREATE TABLE Games 
(gameid INTEGER PRIMARY KEY, 
homeid INTEGER, 
awayid INTEGER);

CREATE TABLE TeamStats 
(gameid INTEGER, 
teamid INTEGER, 
PRIMARY KEY (gameid, teamid));
My datasource isn't perfect, and on rare occasions I end up inserting data into my TeamStats table for a teamid that isn't either the home or away team. I want to delete all rows from my TeamStats table where the teamid isn't equal to either the awayid or homeid for that gameid, but I can't wrap my head around how to do it. I've come up with this:

Code:
DELETE t FROM TeamStats AS t 
JOIN Games AS g 
ON 
g.gameid = t.gameid 
AND g.homeid != t.teamid 
AND g.awayid != t.teamid;
This works in mysql, but it doesn't work in sqlite, which doesn't seem to support joins in deletes, and I can't figure out an alternative that works.

Edit: Alright, I thought it over some more and just hacked together something which works. It's not as clean, but it seems to work with sqlite.

Code:
DELETE FROM TeamStats 
WHERE CAST(gameid AS TEXT) 
|| "," 
|| CAST(teamid AS TEXT) 
IN 
(SELECT CAST(t.gameid AS TEXT) 
|| "," 
|| CAST(t.teamid AS TEXT) 
FROM TeamStats AS t 
JOIN Games AS g 
ON 
g.gameid = t.gameid 
AND 
g.homeid != t.teamid 
AND 
g.awayid != t.teamid);

Last edited by Dudd; 06-19-2012 at 04:28 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-19-2012 , 06:18 AM
Quote:
Originally Posted by daveT
The verdict is in: The Chinese are mystified as well. It could be one of two things:

1- Indicator that the phone is unlocked or simply open.
2- Mail box.
Oh well thanks for asking them anyway! The phone being unlocked (as in not locked to a certain network) sounds plausible.

Anyway, gonna give up the hunt now but will post again if it ever changes to something and/or I ever figure it out.

Juk
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-19-2012 , 08:59 AM
What about mailbox is full? Like this:



Could be a flag saying you're out of memory or something? I don't want to give up the search!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-19-2012 , 09:52 AM
Your sure it isn't the logo of the company?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-19-2012 , 03:09 PM
Quote:
Originally Posted by Gullanian
What about mailbox is full? Like this:



Could be a flag saying you're out of memory or something? I don't want to give up the search!
Yeah, I thought orginally it might be a little flag like that, but after seeing the more highres version in the image above, I don't think so.
Quote:
Originally Posted by kerowo
Your sure it isn't the logo of the company?
Possibly - I think a lot of the phone watches use the same base software/hardware combo and mod it (this is also the case with the Chinese car stereos and I guess a lot of other Chinese gadgetry).

Juk
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m