Mixing jqueryui with bootstrap3

August 25, 2015 at 03:35 PM | categories: jquery, bootstrap, jqueryui | View Comments

During the transition of one website from jqueryui widgets to bootstrap I ran into serveral problems. Since there were too many jqueryui widgets in my code I was not able to convert all of them for the same release but had to live with a mix of old and new (bootstrap) ones in the same HTMl code.

The problems I found were that suddenly jqueryui buttons were not rendered properly or not at all, or other wigets were only partially displayed in my browser, giving a slightly distorted result.

Order matters

It turned out that the order in which I include jquery and bootstrap js and css files matters a lot.

The best result I came up with is:

<link type="text/css" href="/css/jquery-ui-1.11.4/jquery-ui.min.css" />
<link type="text/css" href="/css/jquery-ui-1.11.4/jquery-ui.theme.min.css" />
<link type="text/css" href="/bootstrap/css/bootstrap.min.css">
<script src="/js/jquery-1.11.3.min.js" type="text/javascript"></script>
<script src="/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/js/jquery-ui-1.11.4.min.js" type="text/javascript"></script>

The important one is that bootstrap.min.js is imported AFTER jquery-1.11.3.min.js but BEFORE jquery-ui-1.11.4.min.js.

I still have problems with modal windows not being centered in the viewport but on the entire HTML page instead (which is a problem if the page is very long), but I hopeful get this resolved as well at some point.

Read and Post Comments

Repair grub2 boot after OpenSuse 12.3 update messed it up

September 19, 2014 at 01:20 PM | categories: OpenSuse, grub2, linux | View Comments

After my OpenSuse 12.3 installation ran an automatic update on a few packages I wasn't able to boot the system anymore. Instead I ended up in a minimal grub2 shell without any clue what to do next in order to reboot my system again.

Browsing around the internet from another computer I found that things are getting more difficult as I had my root partition encrypted in a LUKS container. But - there is always hope and so I eventually collected enough information from various blogs and news groups to get my system up and running again.

Here are the instructions that have worked for me.

Boot with OpenSuse 12.3 installation DVD

In order to be able to do anything I started up the installation DVD. Since I needed to get access to my encrypted root file system the smartest way is to choose "Installation" when the DVD provides the initial menu. Don't worry, nothing is installed yet, and it won't, because we will jump out in time.

After choosing "Installation" the system asks to confirm the EULA. Click 'Accept' to continue. Next it will find your LUKS partition - and asks you whether you want to provide the passphrase for decrypting it. So yes, choose decryption and enter your password.

Wait until the decryption is done and the installer is waiting for new input from you. At this point the magic stuff starts. Click Ctrl-Alt-F2 to switch to a text console. You will be already logged in as root (the #-prompt is your friend!).

Mount your system partitions

Type the following command to see your partition setup:

# fdisk -l
[... some output omitted ...]
Device Boot         Start         End      Blocks   Id  System
/dev/sda1            2048    87472127    43735040    7  HPFS/NTFS/exFAT
/dev/sda2   *    87472128    87795711      161792   83  Linux
/dev/sda3        87795712   488396799   200300544   8e  Linux LVM

In my case partition 2 contains my boot system, partition 3 my encrypted root and home partitions.

Type another command to look into the encrypted (only accessible because we did the decryption step above):

# lvscan
ACTIVE            '/dev/system/home' [100.00 GiB] inherit
ACTIVE            '/dev/system/root' [25.00 GiB] inherit
ACTIVE            '/dev/system/swap' [4.00 GiB] inherit

Now lets glue together the original system with some mount commands, using the information above:

# mount /dev/system/root /mnt
# mount /dev/sda2 /mnt/boot
# mount --bind /dev /mnt/dev
# mount -o bind /sys /mnt/sys
# mount -t proc /proc /mnt/proc
# cp /proc/mounts /mnt/etc/mtab

Change the root directory into the mounted filesystem and run grub

# sudo chroot /mnt /bin/bash
# grub2-install /dev/sda

The update-grub command mentioaned in some other blogs does not exist any longer, so use grub2-mkconfig instead to finally generate a new grub.cfg file:

# grub2-mkconfig -o /boot/grub2/grub.cfg

This should print a list of added partitions to your screen.

Quit the chroot environment with ctrl-d and reboot your system (reboot or ctrl-alt-del). Hopefully it boots up again as before.





Read and Post Comments

EuroPython 2014 pyRserve-slides now available online

September 19, 2014 at 11:50 AM | categories: Python, R, pyRserve | View Comments

After our well-attended Python Meetup last Wednesday in Heidelberg about "Connecting Python to other programming languages for scientific computing" I had been approached to publish the slides of my pyRserve talk (which has been the same as the one I've given at EuroPython in Berlin, for those who are interested). These are now online, so feel free to download them.

Read and Post Comments

pyRserve 0.8.1 released

July 18, 2014 at 10:20 AM | categories: Python, R, pyRserve | View Comments

Just in time for EuroPython in Berlin a new version of pyRserve just got released yesterday. If you happen to come to the conference there will be an intoductory talk on pyRserve on Fri 25h of July titled "Combining the powerful worlds of Python and R". Would be great to see you there.

About pyRserve

pyRserve is a (pure python) client for connecting Python to an R process on a remote server via TCP-IP (using Rserve). R is one of the most important and most widely spread open source statistic packages available.

Through such a pyRserve connection the full power of R is available on the Python side without programming in R. From Python variables can get set in and retrieved from R, and R-functions can be created and called remotely. No R-related libraries need to be installed on the client side, pip install pyRserve is all that needs to be done.

Sample code

This code assumes that Rserve (the part that connects the R engine to the network) already is running. Details can be found in the pyRserve docs.

>>> import pyRserve
>>> conn = pyRserve.connect('Rserve.domain.com')
>>> conn.eval('sum( c(1.5, 4) )') # direct evaluation of a statement in R
>>> conn.r.myList = [1, 2, 3] # bind a Python list in R to variable 'myList'

>>> conn.voidEval('func1 <- function(v) { v*2 }')  # create a function in R
>>> conn.r.func1(4)                                # call the function in R

Most important changes in V 0.8.x

  • Support for out-of-bound messages (allows for callbacks from R to Python) (contrib. by Philip. A.)
  • Rserve can now be shutdown remotely (contrib. by Uwe Schmitt)
  • Fixed bug when passing R functions as parameters to R functions
  • Documentation errors have been fixed

Documentation and Support

The documentation for pyRserve is available at http://packages.python.org/pyRserve

The corresponding Google news group can be found at http://groups.google.com/group/pyrserve

Read and Post Comments

Changing selenium's default tmp directory

June 22, 2014 at 03:22 PM | categories: Java, Selenium | View Comments

Changing selenium's default tmp directory

Whenever Selenium fires up Firefox (we are still running Selenium in RC mode) a new Firefox profile directory will be create at every startup. Usually this directory will be created in /tmp - which is for various reasons not always the desired location.

Selenium RC itself has no configuration option to change this location as it relies on the default value provided by java. Fortunately java provides a command line option -Djava.io.tmpdir allowing to specify a new tmp directory.

So change your startup call of Selenium RC to

java -Djava.io.tmpdir=/your/tmp/dir -jar selenium-server.jar

and you're all set.

Read and Post Comments

Next Page ยป