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.

Drop partition scheme with orphan indexes


I have a partition scheme in my SQL Server database that I am trying to drop. This scheme was used by 2 indexes, which I deleted.

I can’t delete the scheme, since it appears to still be used by the indexes, even though they don’t exist anymore.

Running the following query:

select object_name(i.object_id), i.name, i.index_id
FROM   sys.indexes i
JOIN   sys.partition_schemes ps ON i.data_space_id = ps.data_space_id
WHERE  ps.name = 'CallScheme'

I get the names of the 2 tables that had the indexes, but the index names are NULL (and index id is 0).

How do I get rid of these indexes so that I can drop the partition scheme?

How do you compile dependencies manually? Cygwin [closed]


I installed cygwin on windows and the setup.exe doesnt include all the dependencies.
in the folder however, there are many dependencies that arent included in the setup.exe.

when i type in a dependency in the search bar at the top left corner, it doesnt appear, but it IS in the cygwin folder.

enter image description here
enter image description here

is there a way to ammend/add/update dependencies manually, after cygwin has been installed?

how would i do this?

Editing Spec file in RPM


I’m trying to edit a spec file which always fails when I try to install it on other computer using RPM. I’m using CentOS. Here is the error.

error: Failed dependencies:
perl(ActsUtil) is needed by my_program
perl(ParseBishop) is needed by my_program

Both these 2 files are dependencies for the RPM. The thing is, these 2 files are actually provided inside the RPM package. Both these files are .pm file and located inside /opt/mysoftware/bin. I know it can be solved using rpm - ivh --nodeps mysoftware. But I dont prefer to use that method. So, I tried fixing the spec file. Here are some of the code that I’ve tried.

1st try

Summary:....
Name:..
Version:..
....
....
Provides: perl(ParseBishop), perl(ActsUtil)
...
...
%install
...
...
%changelog

2nd try

Summary:....
Name:..
Version:..
....
....
Provides: ParseBishop, ActsUtil
...
...
%install
...
...
%changelog

3rd try

Summary:....
Name:..
Version:..
....
....
Provides: ParseBishop.pm, ActsUtil.pm
...
...
%install
...
...
%changelog

4th try

Summary:....
Name:..
Version:..
....
....
Provides: /opt/mysoftware/bin/ParseBishop, /opt/mysoftware/bin/ActsUtil
...
...
%install
...
...
%changelog

Am I doing the “Provides” command wrong? Or my approach in solving the issue is already wrong? All guide and help are really appreciated.

linux + squashfs-tools for red-hat 5.3


I want to install the squashfs-tools-4.0-5.el6.i686.rpm
But I have the following dependencies ( after RPM installation )

please advice what the additional packages that I need to install on my linux red-hat 5.3 in order to solve the dependencies issue ?

[root@localhost WORK]# rpm -i squashfs-tools-4.0-5.el6.i686.rpm
 warning: squashfs-tools-4.0-5.el6.i686.rpm: Header V3 RSA/SHA1 signature: NOKEY, key  ID c105b9de
  error: Failed dependencies:
    libc.so.6(GLIBC_2.11) is needed by squashfs-tools-4.0-5.el6.i686
    libc.so.6(GLIBC_2.7) is needed by squashfs-tools-4.0-5.el6.i686
    rpmlib(FileDigests) <= 4.6.0-1 is needed by squashfs-tools-4.0-5.el6.i686
    rpmlib(PayloadIsXz) <= 5.2-1 is needed by squashfs-tools-4.0-5.el6.i686

uname -a

   [root@localhost WORK]# uname -a
    Linux localhost 2.6.18-128.el5PAE #1 SMP Wed Dec 17 12:02:33 EST 2008 i686 i686 i386 GNU/Linux

How can i fix the following gmp library dependency error while trying to install Charm?


I am trying to install Charm crypto python framework in ubuntu 11.04 with python 2.7.
Requirements say that i should have gmp installed 5.*. I have successfully installed gmp lib and i have run all the tests. Also after running `

ldconfig -p |grep libgmp

libgmpxx.so.4 (libc6,x86-64) => /usr/lib/libgmpxx.so.4
libgmpxx.so (libc6,x86-64) => /usr/lib/libgmpxx.so
libgmp.so.10 (libc6,x86-64) => /usr/local/lib/libgmp.so.10
libgmp.so.3 (libc6,x86-64) => /usr/lib/libgmp.so.3
libgmp.so (libc6,x86-64) => /usr/local/lib/libgmp.so
libgmp.so (libc6,x86-64) => /usr/lib/libgmp.so

In order to install Charm i have downloaded it from here. I run ./configure, make , make install, and sdconfig as the INSTALL says.

But after running make test for i am getting a lot of errors of this form:

charm/Charm-Crypto-0.43/charm/core/math/integer.so: undefined symbol: __gmpz_powm_sec

Charm shared libraries cannot find libgmp. How can i fix that?
I made an ldd integer.so and it uses libgmp.so.3. In my system libgmp.so.3 is placed under /usr/lib so added this line under te config.mk file of the Charm framework:

LDFLAGS= -m64 -L/usr/lib . 

(-m64 was already there). I make and make install again but i am getting the same error

Inject specific classes or not


I have a TableSqlBuilder interface which has a method getCreateTableSql. This interface is used in some other class as follows:

function createTable( $tableDefinition ) {
    $sql = $this->tableSqlBuilder->getCreateTableSql( $tableDefinition );
    $this->db->execute( $sql );
}

The TableSqlBuilder interface has multiple implementations, such as SQLiteTableSqlBuilder and MySQLTableSqlBuilder.

SQLiteTableSqlBuilder originally created all SQL itself, and had methods to create SQL for an index or for a field. It turned own that the functionality of these methods was needed on its own at other places, so it has been split off into a SQLiteFieldSqlBuilder and a SQLiteIndexSqlBuilder. These classes are instantiated by SQLiteTableSqlBuilder – they are thus not injected, and SQLiteTableSqlBuilder depends on these concrete classes.

I’m unsure if this should be changed to have these field and index sql builders injected. On the one hand this gives more flexibility. It also allows mocking out this behaviour in tests. Then again, the binding and flexibility is currently the same as before the code was split of into new classes.

When going with the injection approach, the accepted types could be FieldSqlBuilder and IndexSqlBuilder, both interfaces implemented by the current concrete classes. This however means one can happily end up with a MySqlIndexBuilder in a SQLiteTableBuilder, which is clearly to be avoided. Could also just type hint against the concrete class, pretending it is an interface, which gets rid of the dependency as long as the construction happens outside of the table sql builder.

Do you think these collaborators should be injected, or is it a valid exception where it is better to not go all the way?

Versioning and deploying dependent systems


I need some best practices or experiences of developer teams who had to treat the same issues I have at the moment =)

Our company is developing a client software for years. The one and only dependency was to have an appropriate database. With each release (update) we also update (incremental) the database if necessary. The versioning schema is well-established and matches our ideology.

Now we have started developing mobile applications (act as external client). Some preliminary remarks to our architecture:

The interface between the mobile client and the database (same database as for the desktop client) is a RESTful webservice. The versioning of both clients are independent. One application is maintained by the desktop development team and the mobile part is maintained by another team.

But I don’t know how to handle the webservice. Should it be independent as well (own versioning) despite the fact that it’s using a lot of shared libraries which are maintained by the desktop development team?

How it works:
The mobile client synchronizes it’s reference data with the webservice which interacts live with the database (read-only access to database).
User data which are produced on the mobile application become also synchronized with the webservice but it’s written to some persistent temporary tables. And an asynchronous job will be started to try the import to the database (could fail in case of locking issues, permissions, ….). If the import fails the same import procedure can also be started on the desktop client (they use the same library for importing from temporary tables to the specific ones)

In general each of these three parts could change (e.g. bugfix, features, performance improvements) without affecting the other two. Therefore I need a strategy to deploy each by itself. Nevertheless most probably it will affect two of three.

Where / when should i check if all three systems are compatible? How should I check this? Having a table in the database with every single possible combination of version which work together?

If you don’t understand my question because it’s entirely ambiguous, please let me know. It’s not that easy to describe =)

Does Debian have any kind of virtual environment for make install?


If someone used a Python virtualenv he knows we can run scripts in its own environment installing all necessary libraries which won’t impact main python distribution.

Do we have something similar in a Linux (Debian) world for make utility?

  1. Case 1: I downloaded sources and I know what dependencies I need. I
    put libraries somewhere in home directory and I explicitly say to
    make utility where to search them.
  2. Case 2: I run some kind of virtualenv for make utility and I call there apt-get install lib-required-dev so downloaded libraries would be placed in this virtual environment and won’t pollute my OS. And then I run make.

How to install a custom boost version in CentOS?


I’m trying to compile and install boost 1.54 from source in CentOS.

The documentation is pretty straight forward and there are plenty of tutorials in the internet available (1) (2) (3). This is what I did:

wget http://sourceforge.net/projects/boost/files/boost/1.54.0/boost_1_54_0.tar.gz
tar -xzvf boost_1_54_0.tar.gz
cd boost_1_54_0
./bootstrap.sh --prefix=/usr/local
./b2 install --with=all

This is compiling and installing boost correctly to /usr/local/lib and everything looks fine.

Now I compile other software that requires boost using gcc and everything works fine. From my understanding everything should be OK as long as gcc finds the required libs.

But now the problem: If I run my compiled binaries I get the following error:

./myProgram
  ./myProgramm: error while loading shared libraries: libboost_system.so.1.54.0: cannot open shared object file: No such file or directory

Why can the libraries not be found?

In addition I tried:

ldconfig
locate boost
  [...]

But boost libraries can not be found. I’ve looked for the path manually, it is:

/usr/local/lib/libboost_system.so.1.54.0

I also tried to create symlinks to /usr/lib but this doesnt fix this either.

Any ideas? What can I do?

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