Bare minimum code for AngularJS Carousel

You can check out the bare minimum bootstrap carousel from the latest bootstrap site: http://getbootstrap.com/javascript/#carousel The next step is getting this into a bare minimum AngularJS directive, which as it turns out is really simple. Links Since Bootstrap requires jQuery for the carousel component, you’ll need the latest version of jQuery: https://code.jquery.com/jquery-2.1.4.js. Also add the necessary links … Read more

How to disable cURL SSL certificate verification

Simply add the -k switch somewhere before the url. Disclaimer: Use this at your own risk. -k, –insecure (TLS) By default, every SSL connection curl makes is verified to be secure. This option allows curl to proceed and operate even for server connections otherwise considered insecure. The server connection is verified by making sure the server’s certificate … Read more

XSLT string replace

replace isn’t available for XSLT 1.0. Codesling has a template for string-replace you can use as a substitute for the function: invoked as: On the other hand, if you literally only need to replace one character with another, you can call translate which has a similar signature. Something like this should work fine: Also, note, in this example, I changed … Read more

R Sweave: NO TeX installation detected

Usually Rstudio finds the correct path to your Latex installation automatically. In your case that doesn’t seem to be the case. After making sure Miktex is installed correctly (have you opened it and compiled a simple file?) you can set the pdflatex path manually: This is the path to my pdflatex.exe file, yours might live … Read more

Categories r Tags

How to fix an UnsatisfiedLinkError (Can’t find dependent libraries) in a JNI project

I’m pretty sure the classpath and the shared library search path have little to do with each other. According to The JNI Book (which admittedly is old), on Windows if you do not use the java.library.path system property, the DLL needs to be in the current working directory or in a directory listed in the Windows PATH environment variable. Update: Looks … Read more

Big Oh for (n log n)

Explanation: The outer for loop should be clear; it is executed n times. Now to the inner loop. In the inner loop, you take n and always divide it by 2. So, you ask yourself: How many times can I divide n by 2? It turns out that this is O (log n). In fact, the base of log is 2, but in Big-O notation, we remove … Read more

importing a CSV into phpmyadmin

In phpMyAdmin, click the table, and then click the Import tab at the top of the page. Browse and open the csv file. Leave the charset as-is. Uncheck partial import unless you have a HUGE dataset (or slow server). The format should already have selected “CSV” after selecting your file, if not then select it … Read more