How to handle passing multiple dependencies in a module hierarchy


So I have my application consisting of a number of modules in a module hierarchy. Furthermore let’s also assume each module is a class and we have a tree of classes where the classes at the top are using the classes below, to make it more simple.

A class A1 at the very bottom may depend on some input parameters. class B1 is above class A1 and is creating and using instances of class A1. Therefore it has to pass the dependencies needed by the instances of class A1 into them. If it can’t create these dependencies from some operations, class B1 now has it’s on dependencies but additionally the dependencies of class A1.
The higher we go the more these dependencies will add up so that the toplevel class will need to know all the dependencies unless they can be created at a lower level.

This means if class A1 my program is dependent on the current temperature, I have to pass this to the toplevel class which then passes it to the next class and so on until it arrives at the very bottom in class A1. If I do that, I make the state explicit but it also means that I have methods or classes that take many parameters.

Variables

What if the temperature is may change while the application is running – is there a way to avoid passing it all the way down the class tree without giving away explicit state? How would you guys handle this?

Constants

What if the temperature is a constant that will never change while the program is running? Does this give us more options to avoid passing it always as an argument? I could see someone using a global configuration (singleton) but it will make it harder to test right?

I could also pass not the temperature itself but a configuration object. This would mean class B1 does not receive for example a temperature and a airpressure parameter but gets a configuration object passes it to class B1 and class B2 where class B1 only needs the airpressure and class B2 only needs the temperature. Is that a good approach? What are the pros/cons?

Converted ERD into Dependency Diagram 1NF, 3NF


enter image description here

Thats the ERD.

I’m studying for an upcoming test and having trouble getting my head around converting thes ERDs into dependency diagrams. This is from a previous exam that the Lecturer told us to study just btw so he said it will be pretty similar to this.

We have to -

-Convert the ERD into a dependency diagram.
-And then, conver that diagram into a 3NF model, with no transitive or partial dependices.

Any help would be much appreciated as I’m struggling to get my head around it and need to pass this test :/

Thanks in advance!

Bundling of dependencies with shell scripts


Shell scripts often have to depend on tools that may not be installed on the users’ computer. To circumvent this problem, many scripts have multiple fallbacks.

IMO doing such things only leads to complex code, and it is not uncommon to find a large chunk of the script just devoted to compatibility reasons.

Why couldn’t be the dependencies just be included in the script? The script could include these programs (as an appended compressed section, like makeself does), and simply use them while running?

To clarify, of course this does not apply to things like wget and curl; the code for each would be minimal in that case. I’m talking about scripts that involve GUIs, and there’s a lot of code to support such programs (zenity/yad/xdialog etc.), which involve wildly different syntaxes.

Is there a reason why the above isn’t done?

Is there any unnecessary packages (like xserver-xorg-video-*) that I can safely uninstall?


There are some packages that are just sitting around on the system doing pretty much nothing – like xserver-xorg-video-”insert graphics card that you don’t use”. I mean, I use a radeon graphics card, wtf is voodoo’s display drivers doing on my computer?

I build my Debian from scratch, I just installed the base system (without even the “standard system utilities” task), and built it from the ground up. In the process, I installed packages like xfce4 (which pulled with it a staggering amount of 400 packages with it), which brought along the above mentioned “packages that I will never use”.

My question is this: what can I uninstall while still keeping a decent looking xfce4 environment (and a decent looking aptitude menu that is not trying to kill me)?

Bonus: Will I totally screw up my system if I uninstall orage (the xfce4 calendar)? Aptitude is not happy about that, and wants to uninstall xfce4 along with orage. I’m pretty sure removing orage won’t change that much, but aptitude don’t agree with me.

Install CUDA 6.0 on Debian 7 via package manager


I am following the official installation guide for Ubuntu. I first installed the cuda-repo package (cuda-repo-ubuntu1304_6.0-37_amd64.deb), which adds the NVIDIA repository to apt. Then it gives when installing that:

$ uname -a
Linux debian 3.14-1-amd64 #1 SMP Debian 3.14.10-1 (2014-07-07) x86_64 GNU/Linux

$ dpkg -i cuda-repo-ubuntu1304_6.0-37_amd64.deb
$ aptitude update
$ aptitude install cuda

The following packages have unmet dependencies:
 nvidia-settings : Depends: screen-resolution-extra (>= 0.12) which is a virtual package.
 nvidia-331 : Depends: xorg-video-abi-11 which is a virtual package. or
                       xorg-video-abi-12 which is a virtual package. or
                       xorg-video-abi-13 which is a virtual package. or
                       xorg-video-abi-14 which is a virtual package.

I cannot find any package named screen-resolution-extra via aptitude search. And there is only a xorg-video-abi-15 in the repository which cannot be installed.

How can I solve this if I want to install CUDA via package manager?

Functional Dependencies Query


I am having a confusion in Functional Dependencies

I have a relation R(A,B,C,D,E,F)
Where {A, B} is the key

And the FD set I have is {A->FC, C->D, B->E}

What Normal Form is it in?

Basically I want easy explanation. For a relation to be in 2NF, it must not have partial dependency, so as B is determining E is it not in 2NF, which means it is in 1NF?

And if it is in 1NF?
Would the relations become {A,B,C,D}, {B,E} and {A,C,F}?

Mac Firebreath plugin port to Linux (dependencies)


I have Firebreath plugin for Mac that I need to port to Linux.

I am trying to find the replacement dependencies for the Linux version.

Here is the dependencies I have in my cmake for Mac:

find_library(COCOA_F Cocoa) 
find_library(FOUNDATION_F Foundation) 
find_library(APPKIT_F AppKit) 
find_library(COREDATA_F CoreData) 
find_library(AGL_F AGL) 
find_library(CARBON_F Carbon) 
find_library(AUDIOTOOLBOX_F AudioToolbox) 
find_library(COREAUDIO_F CoreAudio) 
find_library(AUDIOUNIT_F AudioUnit) 
find_library(QUARTZCORE_F QuartzCore) 
find_library(QUICKTIME_F QuickTime) 
find_library(OPENGL_F OpenGL) 
find_library(QTKIT_F QTKit)

So far I’ve found:

OpenGL       => freeglut3 ?
Cocoa        => GLFW ?

Any suggestions for the other dependencies?

Why do projects opt to stay on an older version of the .NET Framework?


Why do projects opt to stay on an older framework version of the .NET Framework?

For example, staying on .NET Framework version 3.5 which was released in 2007 instead of upgrading to the latest 4.5.1 version?

Jon Skeet’s Noda Time also targets .NET 3.5. Why?

How to Resolve a .so Dependency


I have a package (.rpm) on CentOS 6.5 that requires a .so file, which I also have on my machine. When I attempt to install the package I get an error stating unresolved dependencies regarding the .so file. I have tried placing the .so file in the same directory, in /lib/, in /usr/lib/, and setting the path of LD_LIBRARY_PATH to /usr/lib/, but regardless the package does not resolve the dependency, how can I make the .so available to the package I am installing?

Is it okay to user other open source libraries when building your own or should that be avoided?


Seems like an odd question, but I’ve been questioning this myself for some time now.
I’ve been told that, if you’re working on a open source library/project, you should avoid adding dependencies for other external, open sourced, libraries because that’ll make the software, that uses your libraries, become heavier with all the dependencies, inside dependencies, etc… But sometimes I’m a little on the fence about that. Do I really need to reinvent the wheel just to keep my library away from external dependencies?
For example, I’m currently building an Objective-C project that will be open sourced on Github and I need to use a XML parser to get data from — you guessed it — XML files. Apple’s OS X already has a built-in API for XML parsing, but I’m not very fond of the way it works, it needs a lot of background processing and workarounds to get the data I really need, so I was thinking about using another XML parser to do a much cleaner job in terms of making my life easier, as the developer, but also by making the code a lot more legible for other developers.

What are your thoughts on this? Thank you.

Question and Answer is proudly powered by WordPress.
Theme "The Fundamentals of Graphic Design" by Arjuna
Icons by FamFamFam