text:
Q: How to get links ranges from UITextView in Swift I have a chat app with the UITextView with a dynamic text (comes from the server or is typed by the user). I needed to detect all types of links, and the UITextView does a great job in detecting phone numbers, addresses, hyperlinks and calendar events. Where UITextView falls short is styling, there are multiple problems there:

*

*The address links are not colored with the tintColor or with the color from linkTextAttributes property, or using the appearance() proxy.

*All of the links are underlined by default.

*Some of the links are colored properly, but I fail to see a pattern why certain links are omitted (looks like it may have something to do with the word wrap).

*When setting custom underlineStyle attribute, the text simply disappears.

So I thought the best thing to do would be to still use the UITextView for detecting the links, but then create my own attributed string and style everything the way I want. For this I need the ranges for the links, but I can't find the way to get them.
I tried this:
open func enumerateAttributes(in enumerationRange: NSRange, options opts: NSAttributedString.EnumerationOptions = [], using block: ([NSAttributedString.Key : Any], NSRange, UnsafeMutablePointer<ObjCBool>) -> Void)

But there are never any .link elements, nor any underline attributes if I look for them. So the question is, is there a way to get the link ranges from the UITextView somehow? Or perhaps there is a way to reliably style the links that I'm missing?

A: To detect the Phone Numbers, addresses etc, you are in fact using the NSDataDetector.
That's what you in fact set in InterfaceBuilder there:

Then:
let types: NSTextCheckingResult.CheckingType = [.address, .link, .phoneNumber, .date]
let detector = try? NSDataDetector(types: types.rawValue)
let matches = detector.matches(in: text, options: [], range: NSRange(location: 0, length: text.utf16.count))
matches.forEach {
    guard let range = Range($0.range, in: text) else { return }
    let sub = String(text[range])
    print(sub)
}


text:
Q: string.match doesn't work in Lua for loop I am trying to use a for loop to get author name, id, content of each post in a web forum.
I tried this but it doesn't work. Without the for loop, I will get the first result of the regex in the document.
Any suggestions?
for author_id, author_name, author_joined, author_posts, post_date, post_content in
                string.match(content,
                "([^<]+).-Joined: ([^<]+).-Posts: ([^<]+).-Posted: ([^<]+).-(.-)")
        do
             document:appendContent("Name: " .. author_name)
        end
end

A: To be used in a generic for loop, you need an iterator, use string.gmatch (global match) instead of string.match.

redpajama_set_name: RedPajamaStackExchange


text:
Q: how to center items in glidejs without change settings As is seem image below, total item slot is 7, but source are dynamic and sometimes its 3 or 4..
How to centeralize these items properly using glidejs

Source code preview:
<Slider element="glide" options={{ perView: 7 }}>
    {Object.entries(subSliderItems)
    .map(([key, value]) => (
        <div className="glide__slide" key={key}>
        <BoxSubCategory label={key} url={value} />
        </div>
    ))}
</Slider>

A: I just came across this issue today, and after a bit of poking around found the solution to be surprisingly simple.
.glider-track {
    margin: auto;
}

The div .glider-track is added to the dom as a wrapper for your slides so centring them within this will do the trick.

A: .glide * {
  margin: 0 auto;
}

Add this to your CSS so it will make your content in the center.


text:
Q: In Azure API Management can i use the subscription-key as part of Request headers instead of Query string parameter? I am migrating a service to Azure API Management. This service is being called from mobile devices (native apps). Problem is that appending the subscription-key to the query string can take much longer for updating the app than just using it in the request headers.
So is it possible to use it there?

A: As an Add-on to @vladvino post.  This is configurable per API.   It is available in the Setting pane of the API Settings in the Azure APIM Portal.

A: The subscription key can be passed either in the header or in the URL query parameter. The header is checked first. The query parameter is checked only if the header is not present. The header name is Ocp-Apim-Subscription-Key by default though you can change it; the same holds for the query parameter whose default name is subscription-key.


text:
Q: tiovx-app-host error on arago yocto project on cunstom AM57xx board I'm trying to compile tiovx-app-host for arago yocto(ROCKO) project for AM57xx-evm board its compiled, But same for my custom am57xx board gives an error regarding ld. Even I did not changed tiovx-app-host.bb file.
DEBUG: Executing shell function do_compile
NOTE: make -j 3 TARGET_ROOTDIR=/home/_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot GCCLINARO=/home/sangeet/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf TIOVXPATH=/home//am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-tiovx-lib-tree IPCPATH=/home_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree SDKPLATFORMIFPATH=/home/am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-tiovx-lib-tree/sys-iface PROC_LIST=host khronos_example
#
#
# Making host ...
# Making khronos_example ...
make -C host PROCLIST="host khronos_example"
make -C khronos_example PROCLIST="host khronos_example"
make[1]: Entering directory '/home/c_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/host'
#
make[1]: Entering directory '/home/_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example'
# Making all ...
make PROFILE=debug app_host
#
make[2]: Entering directory '/home/_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/host'
# Making all ...
make PROFILE=debug opticalflow
make[2]: Entering directory '/home/_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example'
#
#
/home/sangeet/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -c -MD -MF vx_platform.o.dep -I/home/_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include -Wall -ffloat-store -fPIC -Wunused -pthread -Dfar= -ggdb -D DEBUG -O0 -I. -I.. -I/home/_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-tiovx-lib-tree/sys-iface -I/home/_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include/VX -DOPENVX_INCLUDE -I/home/_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/linux/include -I/home/_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/packages  -D_REENTRANT `pkg-config --cflags opencv`  -c -o vx_platform.o ../host/vx_platform.c
# Making bin/debug/obj/main_host.ov7A ...
/home/sangeet/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -c -MD -MF bin/debug/obj/main_host.ov7A.dep  -D_REENTRANT -I/home/_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include -Wall -ffloat-store -fPIC -Wunused -pthread -Dfar= -ggdb -D DEBUG -I. -I.. -I/home/c_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-tiovx-lib-tree/sys-iface -I/home/_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include/VX -DOPENVX_INCLUDE -I/home/_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/linux/include -I/home/_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/packages -o bin/debug/obj/main_host.ov7A main_host.c
# Making bin/debug/obj/vx_platform.ov7A ...
/home/sangeet/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -c -MD -MF bin/debug/obj/vx_platform.ov7A.dep  -D_REENTRANT -I/home/_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include -Wall -ffloat-store -fPIC -Wunused -pthread -Dfar= -ggdb -D DEBUG -I. -I.. -I/home//_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-tiovx-lib-tree/sys-iface -I/home/c_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include/VX -DOPENVX_INCLUDE -I/home/_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/linux/include -I/home/_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/packages -o bin/debug/obj/vx_platform.ov7A vx_platform.c
/bin/sh: pkg-config: command not found
main_host.c: In function 'main':
main_host.c:83:9: warning: implicit declaration of function 'TestModuleRegister' [-Wimplicit-function-declaration]
         TestModuleRegister();
         ^~~~~~~~~~~~~~~~~~
main_host.c:84:9: warning: implicit declaration of function 'tivx_set_debug_zone' [-Wimplicit-function-declaration]
         tivx_set_debug_zone(0);
         ^~~~~~~~~~~~~~~~~~~
main_host.c:86:9: warning: implicit declaration of function 'vx_conformance_test_main' [-Wimplicit-function-declaration]
         vx_conformance_test_main(argc, argv);
         ^~~~~~~~~~~~~~~~~~~~~~~~
../host/vx_platform.c: In function 'System_ipcNotifyRecvFxn':
../host/vx_platform.c:582:11: warning: variable 'status' set but not used [-Wunused-but-set-variable]
     Int32 status;
           ^~~~~~
vx_platform.c: In function 'System_ipcNotifyRecvFxn':
vx_platform.c:582:11: warning: variable 'status' set but not used [-Wunused-but-set-variable]
     Int32 status;
           ^~~~~~
../host/vx_platform.c: In function 'System_ovxAllocMem':
../host/vx_platform.c:660:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     ptr = HeapMem_alloc (0, size, 4096);
         ^
vx_platform.c: In function 'System_ovxAllocMem':
vx_platform.c:660:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     ptr = HeapMem_alloc (0, size, 4096);
         ^
../host/vx_platform.c:651:22: warning: unused variable 'prms' [-Wunused-variable]
     CMEM_AllocParams prms;
                      ^~~~
vx_platform.c:651:22: warning: unused variable 'prms' [-Wunused-variable]
     CMEM_AllocParams prms;
                      ^~~~
vx_platform.c: In function 'System_ovxFreeMem':
../host/vx_platform.c: In function 'System_ovxFreeMem':
vx_platform.c:672:22: warning: unused variable 'prms' [-Wunused-variable]
     CMEM_AllocParams prms;
                      ^~~~
../host/vx_platform.c:672:22: warning: unused variable 'prms' [-Wunused-variable]
     CMEM_AllocParams prms;
                      ^~~~
../host/vx_platform.c:685:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
vx_platform.c:685:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
/home/sangeet/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -c -MD -MF tialloc.o.dep -I/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include -Wall -ffloat-store -fPIC -Wunused -pthread -Dfar= -ggdb -D DEBUG -O0 -I. -I.. -I/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-tiovx-lib-tree/sys-iface -I/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include/VX -DOPENVX_INCLUDE -I/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/linux/include -I/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/packages  -D_REENTRANT `pkg-config --cflags opencv`  -c -o tialloc.o ../host/tialloc.c
arm-linux-gnueabihf-g++  -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard --sysroot=/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot  -D_REENTRANT `pkg-config --cflags opencv` -I/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include -Wall -ffloat-store -fPIC -Wunused -pthread -Dfar= -ggdb -D DEBUG -O0 -I. -I.. -I/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-tiovx-lib-tree/sys-iface -I/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include/VX -DOPENVX_INCLUDE -I/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/linux/include -I/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/packages -c solution_exercise1.cpp
#
/bin/sh: pkg-config: command not found
/bin/sh: pkg-config: command not found
# Making bin/debug/obj/tialloc.ov7A ...
/home/sangeet/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -c -MD -MF bin/debug/obj/tialloc.ov7A.dep  -D_REENTRANT -I/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include -Wall -ffloat-store -fPIC -Wunused -pthread -Dfar= -ggdb -D DEBUG -I. -I.. -I/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-tiovx-lib-tree/sys-iface -I/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include/VX -DOPENVX_INCLUDE -I/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/linux/include -I/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/packages -o bin/debug/obj/tialloc.ov7A tialloc.c
../host/tialloc.c: In function 'HeapMem_init':
tialloc.c: In function 'HeapMem_init':
../host/tialloc.c:304:4: warning: 'memset' used with constant zero length parameter; this could be due to transposed parameters [-Wmemset-transposed-args]
    memset ((char *)block_base, size, 0);
    ^~~~~~
tialloc.c:304:4: warning: 'memset' used with constant zero length parameter; this could be due to transposed parameters [-Wmemset-transposed-args]
    memset ((char *)block_base, size, 0);
    ^~~~~~
#
# Making bin/debug/app_host ...
/home/sangeet/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -L/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/linux/src/api/.libs/ -L/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/linux/src/utils/.libs -L/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/linux/src/transport/.libs -L/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/lib -L/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/lib -ggdb -Wall -Wl,-Map=bin/debug/app_host.map -o bin/debug/app_host bin/debug/obj/main_host.ov7A bin/debug/obj/vx_platform.ov7A bin/debug/obj/tialloc.ov7A -lpthread -lc -lrt -lm -lticmem -Wl,--start-group  -lvx_tiovx_tests -lvx_kernels_openvx_core -lvx_conformance_tests -lvx_conformance_engine -lvx_conformance_tests_testmodule -lvx_vxu -lvx_platform_vision_sdk_linux -lvx_framework -Wl,--end-group  -ltiipc -ltiipcutils -ltitransportrpmsg
solution_exercise1.cpp: In function 'int main(int, char**)':
solution_exercise1.cpp:162:16: warning: unused variable 'trackable_kp_ratio_thr' [-Wunused-variable]
     vx_float32 trackable_kp_ratio_thr  = 0.8f;                  // threshold for the ration of tracked keypoints to all
                ^~~~~~~~~~~~~~~~~~~~~~
#
/bin/sh: pkg-config: command not found
#CPP flags:  -D_REENTRANT
#LD flags: -L/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/linux/src/api/.libs/ -L/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/linux/src/utils/.libs -L/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/linux/src/transport/.libs -L/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/lib -L/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/lib -ggdb -O0 -Wall -Wl,-Map=bin/debug/opticalflow.map -Wl,-rpath-link=/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/lib
# Making bin/debug/opticalflow ...
/home/sangeet/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -L/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/linux/src/api/.libs/ -L/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/linux/src/utils/.libs -L/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/share/ti/ti-ipc-tree/linux/src/transport/.libs -L/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/lib -L/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/lib -ggdb -O0 -Wall -Wl,-Map=bin/debug/opticalflow.map -Wl,-rpath-link=/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/lib -o bin/debug/opticalflow vx_platform.o tialloc.o solution_exercise1.o -lpthread -lc -lrt -lm -lticmem -lstdc++ -Wl,--start-group -lvx_kernels_openvx_core -lvx_platform_vision_sdk_linux -lvx_framework -Wl,--end-group `pkg-config --libs opencv` -ltbb -lz -ludev -ltiipc -ltiipcutils -ltitransportrpmsg
/bin/sh: pkg-config: command not found
/home/sangeet/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.2.1/../../../../arm-linux-gnueabihf/bin/ld: warning: libcap.so.2, needed by /home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/lib/libudev.so, not found (try using -rpath or -rpath-link)
solution_exercise1.o: In function `cv::String::String(char const*)':
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include/opencv2/core/cvstd.hpp:625: undefined reference to `cv::String::allocate(unsigned int)'
solution_exercise1.o: In function `cv::String::~String()':
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include/opencv2/core/cvstd.hpp:667: undefined reference to `cv::String::deallocate()'
solution_exercise1.o: In function `cv::Mat::~Mat()':
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include/opencv2/core/mat.inl.hpp:571: undefined reference to `cv::fastFree(void*)'
solution_exercise1.o: In function `cv::Mat::release()':
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include/opencv2/core/mat.inl.hpp:682: undefined reference to `cv::Mat::deallocate()'
solution_exercise1.o: In function `cv::String::String(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/recipe-sysroot/usr/include/opencv2/core/cvstd.inl.hpp:81: undefined reference to `cv::String::allocate(unsigned int)'
solution_exercise1.o: In function `CGuiModule::CGuiModule(char const*)':
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:53: undefined reference to `cv::VideoCapture::VideoCapture(cv::String const&)'
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:56: undefined reference to `cv::VideoCapture::isOpened() const'
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:63: undefined reference to `cv::namedWindow(cv::String const&, int)'
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:53: undefined reference to `cv::VideoCapture::~VideoCapture()'
solution_exercise1.o: In function `CGuiModule::CGuiModule(int)':
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:68: undefined reference to `cv::VideoCapture::VideoCapture(int)'
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:72: undefined reference to `cv::VideoCapture::isOpened() const'
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:79: undefined reference to `cv::namedWindow(cv::String const&, int)'
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:68: undefined reference to `cv::VideoCapture::~VideoCapture()'
solution_exercise1.o: In function `CGuiModule::GetWidth()':
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:85: undefined reference to `cv::VideoCapture::get(int) const'
solution_exercise1.o: In function `CGuiModule::Grab()':
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:114: undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:116: undefined reference to `cv::VideoCapture::operator>>(cv::Mat&)'
solution_exercise1.o: In function `CGuiModule::DrawText(int, int, char const*)':
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:120: undefined reference to `cv::putText(cv::_InputOutputArray const&, cv::String const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)'
solution_exercise1.o: In function `CGuiModule::DrawPoint(int, int)':
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:130: undefined reference to `cv::circle(cv::_InputOutputArray const&, cv::Point_<int>, int, cv::Scalar_<double> const&, int, int, int)'
solution_exercise1.o: In function `CGuiModule::DrawArrow(int, int, int, int)':
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:141: undefined reference to `cv::line(cv::_InputOutputArray const&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)'
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:142: undefined reference to `cv::line(cv::_InputOutputArray const&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)'
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:143: undefined reference to `cv::line(cv::_InputOutputArray const&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)'
solution_exercise1.o: In function `CGuiModule::Show()':
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:150: undefined reference to `cv::imshow(cv::String const&, cv::_InputArray const&)'
solution_exercise1.o: In function `CGuiModule::AbortRequested()':
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:156: undefined reference to `cv::waitKey(int)'
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:159: undefined reference to `cv::waitKey(int)'
solution_exercise1.o: In function `CGuiModule::WaitForKey()':
/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example/opencv_camera_display.h:171: undefined reference to `cv::waitKey(int)'
make[2]: Leaving directory '/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/host'
make[1]: Leaving directory '/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/host'
collect2: error: ld returned 1 exit status
makefile:78: recipe for target 'bin/debug/opticalflow' failed
make[2]: *** [bin/debug/opticalflow] Error 1
make[2]: Leaving directory '/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example'
makefile:55: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/git/khronos_example'
makefile:49: recipe for target 'khronos_example' failed
make: *** [khronos_example] Error 2
ERROR: oe_runmake failed
WARNING: /home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/temp/run.do_compile.14916:1 exit 1 from 'exit 1'
ERROR: Function failed: do_compile (log file is located at /home/sangeet/source/user_am57x/tisdk/build/arago-tmp-external-linaro-toolchain/work/am5728_core_rdk-linux-gnueabi/tiovx-app-host/01.00.01.00-r2/temp/log.do_compile.14916)

A: I have added inherit pkgconfig to my recipe and its working fine.


text:
Q: Unable to animate div element using CSS when assigned to multiple classes I'm trying to apply a CSS animation to multiple div elements as in the following HTML code:
{% for i in player_range %}
<div id="container-frame-{{ i }}" class="container-frame borderblinker">
...
</div>
{% endfor %}

Where container-frame is the frame of the div element and borderblinker is the css needed to perform animation for these borders.
Below is the CSS style I'm applying for each element.
.container-frame {
    position: absolute;
    border-style: solid;
    border-width: 5px;
    border-color: whitesmoke;
        }
@keyframes borderblinker {
    0%    {border-color: #444444;}
    10%    {border-color: #4C4C4C;}
    20.0%  {border-color: #4C3333;}
    30.0%  {border-color: #660000;}
    40.0%  {border-color: #4C1919;}
    50.0%  {border-color: #990000;}
    60.0%  {border-color: #CC0000;}
    70.0%  {border-color: #FF0000;}
    100.0%  {border-color: #FF0000;}
    }
div{
    animation-name: borderblinker;
    animation-timing-function: step-end ;
    animation-iteration-count: infinite ;
    animation-direction: alternate ;
    animation-duration: 2s;
    }

The border style is applied correctly, however, the div elements do not blink. Any idea what could be the problem ?

A: you forgot to set an "animation-duration".
But there is also some unclear code:
The problem is the class "container-frame".
Because your div is not only a div but also has the class "container-frame", it gets a fixed border-style and border-color. Even though you have defined an animation for the tag "div" below, the class selector gets the priority because of the cascading order. classes get prioritised over tag selectors.
http://monc.se/kitchen/38/cascading-order-and-inheritance-in-css
You could solve the problem by targeting the animation div also with a class selector instead of just the tag selector:
div.container-frame{
    animation-name: borderblinker;
    animation-timing-function: step-end ;
    animation-iteration-count: infinite ;
    animation-direction: alternate ;
    }

A: When I deleted the border-color from container-frame, the problem was solved. Thanks to @KevDev
@keyframes example {
        0%    {border-color: #444444;}
        10%    {border-color: #4C4C4C;}
        20.0%  {border-color: #4C3333;}
        30.0%  {border-color: #660000;}
        40.0%  {border-color: #4C1919;}
        50.0%  {border-color: #990000;}
        60.0%  {border-color: #CC0000;}
        70.0%  {border-color: #FF0000;}
        100.0%  {border-color: #FF0000;}
    }
    .container-frame {
        position: absolute;
        border-style: solid;
        border-width: 5px;
        animation-duration: 0.5s;
        animation-name: example;
        animation-timing-function: step-end ;
        animation-iteration-count: infinite ;
        animation-direction: alternate ;
    }


text:
Q: Calling visual C++ code from C# I got stuck with a "ref" keyword which is applied to the class in .cpp file.
I want to access a method which is marked as __clrcall. Can u tell me what ref
keyword used for in visual c++ code?

A: From MSDN:

A ref class or ref struct can inherit from zero or more managed interfaces and zero or one ref types. A value class or value struct can only inherit from zero or more managed interfaces.
Link

A: The "short short" version is that a "ref class" is a managed class.  You can't have member variables of a managed type (.NET Library objects, like StringBuilder or TCPListener) in a class that is not declared "ref" -- that is, unmanaged classes cannot contain managed objects.


text:
Q: Model.findByIdAndUpdate() with validate Author I want update Category with validate Author
I have two models:
Category: { id, title, description, author } //author contains userId
User: { id, name, categories } //categories contain categoryId.
I want to check: Only author can update author's category, if you are not author, you can not update this category. How can I do it?
My code without findByIdAndUpdate():

My code with findByIdAndUpdate():
const update = async (id, updatedCategory, authorId) => {
    try {
        const { title, description } = updatedCategory
        const query = {
          ...(title && { title }),
          ...(description && { description }),
          date: Date.now(),
        }

        let category = await Category.findByIdAndUpdate(id, query,
        (error, doc) => {
            return doc
        }

        if (!category) throw "Can not find category"
        // How to validate with authorId?
        return category
    } catch (error) {
        throw error
    }
}

A: You need to make little modification in query. Instead of findByIdAndUpdate use findOneAndUpdate.
const update = async (id, updatedCategory, authorId) => {
    try {
        const { title, description } = updatedCategory
        const query = {
          ...(title && { title }),
          ...(description && { description }),
          date: Date.now(),
        }

        let category = await Category.findOneAndUpdate({_id:id, author:authorId}, query,
        (error, doc) => {
            return doc
        }

        if (!category) throw "Can not find category"
        // How to validate with authorId?
        return category
    } catch (error) {
        throw error
    }
}


text:
Q: Matlab stand-alone executables fail to run at first launch but then works I have made a (Windows) installer program that installs the Matlab Compiler Runtime (R2012b) and then, after restart, tries to automatically launch a Matlab stand-alone executable compiled with the same compiler version. I have administrator rights on the computer and the executable is tagged "Run as admininstrator". I have tried this installation procedure on a number of different computer platforms with the following results:

*

*Win 7 and Win 10 upgraded from Win 7: The executable launces automatically at start-up without issues

*Windows 8 and Win 10 upgraded from Win 8: The executable will most often fail to launch at the first attempt (won't start at all, no code executed) but may work the next. Once it works, it will always work.
This is obviously a problem since my customers, who use arbitrary platforms, are supposed to do this install. If the executable fails at startup, their account is not set up properly and they will not be able to run the installed software. I paid a lot for the Matlab compiler and I really think I could expect a more stable behaviour. Do I need to write something to the Windows registry beforehand, and what? Is there a command line I can add to the executable to force it to run and what should it say?
Your help is greatly apppreciated!
Fredrik
PS. This question has also been posted on Matlab Answers


text:
Q: How to call shell from perl script Perl script reads url from config file. In config file data stored as URL=http://example.com.
How can I get site name only. I've tried
open(my $fh, "cut -d= -f2 'webreader.conf'");

But it doesn't work.
Please, help!

A: You have to indicate with reading pipe -| that what follows is command which gets forked,
open(my $fh, "-|", "cut -d= -f2 'webreader.conf'") or die $!;

print <$fh>; # print output from command

Better approach would be to read file directly by perl,
open( my $fh, "<", "webreader.conf" ) or die $!;
while (<$fh>) {
    chomp;
    my @F = split /=/;
    print @F > 1 ? "$F[1]\n" : "$_\n";
}

A: Maybe something like this?
$ cat urls.txt
URL=http://example.com
URL=http://example2.com
URL=http://exampleXXX.com

$ ./urls.pl
http://example.com
http://example2.com
http://exampleXXX.com

$ cat urls.pl
#!/usr/bin/perl

$file='urls.txt';
open(X, $file) or die("Could not open  file.");

while (<X>) {
    chomp;
    s/URL=//g;
    print "$_\n";
}
close (X);


text:
Q: Page getting cached in Magento 2 I am trying to display random products on the homepage. but my page is getting cached and on refresh, same products are displayed. I used AJAX post request also but did not work. Can anybody say how can I avoid my page getting cached?
Read many articles, tried every possible way, but did not work.
Here is my ajax code
<script>
    require([
        'jquery'
    ], function($){
        jQuery.ajax({
        url: "/homepage/ajax/loadcategory",
        type: "POST",
        data: "",
        success: function (res) {
            if(res.indexOf("find products matching the selection") > -1){
             alert("Hello world.......");
            return;
            }
         alert("Hello world");
            var result = jQuery('.product-item-info', res).html();
            jQuery(".product-item").show();
            jQuery(".randomProd .product-item .product-item-info").html(result);
        }
        });
    });


text:
Q: Could not find rake-10.1.0 in any of the sources I have been working with rails and have been trying to setup passenger with rake 10.1.0 and it sends back me this errors.
Here is the link to the error.Website LInk
It looks like Bundler could not find a gem. This is probably because your
application is being run under a different environment than it's supposed to.
Please check the following:

 * Is this app supposed to be run as the `rails` user?
 * Is this app being run on the correct Ruby interpreter? Below you will
   see which Ruby interpreter Phusion Passenger attempted to use.
 * Are you using RVM? Please check whether the correct gemset is being used.
 * If all of the above fails, try resetting your RVM gemsets:
   https://github.com/phusion/passenger/wiki/Resetting-RVM-gemsets

-------- The exception is as follows: -------
Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound)
  /usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize'
  /usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!'
  /usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize'
  /usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
  /usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in `specs_for'
  /usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in `requested_specs'
  /usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in `requested_specs'
  /usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in `setup'
  /usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
  /usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
  /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `require'
  /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
  /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in `require'
  /home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/loader_shared_helpers.rb:219:in `block in run_load_path_setup_code'
  /home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/loader_shared_helpers.rb:333:in `running_bundler'
  /home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/loader_shared_helpers.rb:217:in `run_load_path_setup_code'
  /home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/helper-scripts/rack-preloader.rb:96:in `preload_app'
  /home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/helper-scripts/rack-preloader.rb:150:in `<module:App>'
  /home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
  /home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/helper-scripts/rack-preloader.rb:28:in `<main>'
Application root
/home/rails/testourwedding
Environment (value of RAILS_ENV, RACK_ENV, WSGI_ENV and PASSENGER_ENV)
production
Ruby interpreter command
/usr/local/rvm/wrappers/ruby-2.0.0-p353@global/ruby
User and groups
uid=1000(rails) gid=1000(rails) groups=1000(rails),0(root),27(sudo),1001(rvm)
Environment variables
APACHE_PID_FILE = /var/run/apache2/apache2.pid
rvm_bin_path = /usr/local/rvm/bin
GEM_HOME = /usr/local/rvm/gems/ruby-2.0.0-p353@global
APACHE_RUN_USER = www-data
SHELL = /bin/bash
IRBRC = /usr/local/rvm/rubies/ruby-2.0.0-p353/.irbrc
PYTHONUNBUFFERED = 1
PASSENGER_DEBUG_DIR = /tmp/passenger.spawn-debug.XXXXcwNYKJ
SERVER_PORT = 80
MY_RUBY_HOME = /usr/local/rvm/rubies/ruby-2.0.0-p353
USER = rails
DOCUMENT_ROOT = /home/rails/testourwedding/public
_system_type = Linux
REQUEST_URI = /
rvm_path = /usr/local/rvm
IN_PASSENGER = 1
RACK_ENV = production
REMOTE_PORT = 53796
rvm_prefix = /usr/local
PATH = /usr/local/rvm/gems/ruby-2.0.0-p353@global/bin:/usr/local/rvm/gems/ruby-2.0.0-p353@global/bin:/usr/local/rvm/rubies/ruby-2.0.0-p353/bin:/usr/local/rvm/bin:/usr/local/rvm/gems/ruby-2.0.0-p353/bin:/usr/local/rvm/gems/ruby-2.0.0-p353@global/bin:/usr/local/rvm/rubies/ruby-2.0.0-p353/bin:/usr/local/rvm/bin:/usr/local/bin:/usr/bin:/bin
APACHE_LOG_DIR = /var/log/apache2
WSGI_ENV = production
SERVER_ADMIN = [no address given]
PWD = /home/rails/testourwedding
LANG = C
APACHE_RUN_GROUP = www-data
NODE_PATH = /home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/node_lib
_system_arch = x86_64
NODE_ENV = production
_system_version = 13.10
rvm_env_string = ruby-2.0.0-p353@global
REMOTE_ADDR = 72.32.146.52
rvm_version = 1.24.7 (stable)
SERVER_NAME = www.brandtandlaura.com
HOME = /home/rails
SHLVL = 0
rvm_gemset_name = global
RAILS_ENV = production
rvm_ruby_string = ruby-2.0.0-p353
SERVER_SOFTWARE = Apache/2.4.6 (Ubuntu)
LOGNAME = rails
QUERY_STRING =
SERVER_ADDR = 166.78.174.208
GEM_PATH = /usr/local/rvm/gems/ruby-2.0.0-p353@global
SERVER_PROTOCOL = HTTP/1.1
PASSENGER_APP_ENV = production
APACHE_RUN_DIR = /var/run/apache2
APACHE_LOCK_DIR = /var/lock/apache2
REQUEST_METHOD = GET
RUBY_VERSION = ruby-2.0.0-p353
_system_name = Ubuntu
_ORIGINAL_GEM_PATH = /usr/local/rvm/gems/ruby-2.0.0-p353@global
Ulimits
Unknown
System memory usage
             total       used       free     shared    buffers     cached
Mem:          4001       1870       2131          0        180       1488
-/+ buffers/cache:        202       3799
Swap:            0          0          0
General Ruby interpreter information
RUBY_VERSION = 2.0.0
RUBY_PLATFORM = x86_64-linux
RUBY_ENGINE = ruby
RubyGems version = 2.1.11
Ruby configuration (RbConfig::CONFIG)
DESTDIR =
MAJOR = 2
MINOR = 0
TEENY = 0
PATCHLEVEL = 353
INSTALL = /usr/bin/install -c
EXEEXT =
prefix = /usr/local/rvm/rubies/ruby-2.0.0-p353
ruby_install_name = ruby
RUBY_INSTALL_NAME = ruby
RUBY_SO_NAME = ruby
exec = exec
ruby_pc = ruby-2.0.pc
PACKAGE = ruby
BUILTIN_TRANSSRCS =  newline.c
USE_RUBYGEMS = YES
MANTYPE = doc
NROFF = /usr/bin/nroff
vendorarchhdrdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/include/ruby-2.0.0/vendor_ruby/x86_64-linux
sitearchhdrdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/include/ruby-2.0.0/site_ruby/x86_64-linux
rubyarchhdrdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/include/ruby-2.0.0/x86_64-linux
vendorhdrdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/include/ruby-2.0.0/vendor_ruby
sitehdrdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/include/ruby-2.0.0/site_ruby
rubyhdrdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/include/ruby-2.0.0
UNIVERSAL_INTS =
UNIVERSAL_ARCHNAMES =
configure_args =  '--prefix=/usr/local/rvm/rubies/ruby-2.0.0-p353' '--disable-install-doc' '--enable-shared'
vendorarchdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/vendor_ruby/2.0.0/x86_64-linux
vendorlibdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/vendor_ruby/2.0.0
vendordir = /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/vendor_ruby
sitearchdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/x86_64-linux
sitelibdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0
sitedir = /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby
rubyarchdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux
rubylibdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0
ruby_version = 2.0.0
sitearch = x86_64-linux
arch = x86_64-linux
sitearchincludedir = /usr/local/rvm/rubies/ruby-2.0.0-p353/include/x86_64-linux
archincludedir = /usr/local/rvm/rubies/ruby-2.0.0-p353/include/x86_64-linux
sitearchlibdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/x86_64-linux
archlibdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/x86_64-linux
RI_BASE_NAME = ri
ridir = /usr/local/rvm/rubies/ruby-2.0.0-p353/share/ri
rubysitearchprefix = /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/x86_64-linux
rubyarchprefix = /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/x86_64-linux
rubylibprefix = /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby
MAKEFILES = Makefile
PLATFORM_DIR =
THREAD_MODEL = pthread
SYMBOL_PREFIX =
EXPORT_PREFIX =
COMMON_HEADERS =
COMMON_MACROS =
COMMON_LIBS =
MAINLIBS =
ENABLE_SHARED = yes
DLDLIBS =  -lc
SOLIBS = -lpthread -lrt -ldl -lcrypt -lm
LIBRUBYARG_SHARED = -Wl,-R -Wl,/usr/local/rvm/rubies/ruby-2.0.0-p353/lib -L/usr/local/rvm/rubies/ruby-2.0.0-p353/lib -lruby
LIBRUBYARG_STATIC = -Wl,-R -Wl,/usr/local/rvm/rubies/ruby-2.0.0-p353/lib -L/usr/local/rvm/rubies/ruby-2.0.0-p353/lib -lruby-static
LIBRUBYARG = -Wl,-R -Wl,/usr/local/rvm/rubies/ruby-2.0.0-p353/lib -L/usr/local/rvm/rubies/ruby-2.0.0-p353/lib -lruby
LIBRUBY = libruby.so.2.0.0
LIBRUBY_ALIASES = libruby.so.2.0 libruby.so
LIBRUBY_SO = libruby.so.2.0.0
LIBRUBY_A = libruby-static.a
RUBYW_INSTALL_NAME =
rubyw_install_name =
LIBRUBY_DLDFLAGS = -Wl,-soname,libruby.so.2.0
LIBRUBY_LDSHARED = gcc -shared
EXTDLDFLAGS =
EXTLDFLAGS =
strict_warnflags = -ansi -std=iso9899:199409
warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration
debugflags = -ggdb3
optflags = -O3 -fno-fast-math
cxxflags =  -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration
cflags =  -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration
cppflags =
NULLCMD = :
DLNOBJ = dln.o
INSTALLDOC = nodoc
CAPITARGET = nodoc
RDOCTARGET = nodoc
DTRACE_GLOMMED_OBJ =
DTRACE_OBJ =
DTRACE_EXT = dmyh
EXECUTABLE_EXTS =
ARCHFILE =
LIBRUBY_RELATIVE = no
EXTOUT = .ext
RUNRUBY_COMMAND = $(MINIRUBY) $(srcdir)/tool/runruby.rb --extout=.ext $(RUNRUBYOPT)
PREP = miniruby
BTESTRUBY = $(MINIRUBY)
CROSS_COMPILING = no
TEST_RUNNABLE = yes
setup = Setup
EXTSTATIC =
STRIP = strip -S -x
TRY_LINK =
LIBPATHENV = LD_LIBRARY_PATH
RPATHFLAG =  -Wl,-R%1$-s
LIBPATHFLAG =  -L%1$-s
LINK_SO =
LIBEXT = a
DLEXT2 =
DLEXT = so
LDSHAREDXX = g++ -shared
LDSHARED = gcc -shared
CCDLFLAGS = -fPIC
STATIC =
ARCH_FLAG =
DLDFLAGS =
ALLOCA =
codesign =
POSTLINK = :
WERRORFLAG = -Werror
CHDIR = cd -P
RMALL = rm -fr
RMDIRS = rmdir --ignore-fail-on-non-empty -p
RMDIR = rmdir --ignore-fail-on-non-empty
CP = cp
RM = rm -f
PKG_CONFIG = pkg-config
PYTHON =
DOXYGEN =
DOT =
DTRACE =
MAKEDIRS = /bin/mkdir -p
MKDIR_P = /bin/mkdir -p
INSTALL_DATA = /usr/bin/install -c -m 644
INSTALL_SCRIPT = /usr/bin/install -c
INSTALL_PROGRAM = /usr/bin/install -c
SET_MAKE =
LN_S = ln -s
NM = nm
DLLWRAP =
WINDRES =
OBJCOPY = :
OBJDUMP = objdump
ASFLAGS =
AS = as
AR = ar
RANLIB = ranlib
try_header =
COUTFLAG = -o
OUTFLAG = -o
CPPOUTFILE = -o conftest.i
GNU_LD = yes
LD = ld
GCC = yes
EGREP = /bin/grep -E
GREP = /bin/grep
CPP = gcc -E
CXXFLAGS =  -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration
CXX = g++
OBJEXT = o
CPPFLAGS =
LDFLAGS = -L. -fstack-protector -rdynamic -Wl,-export-dynamic
CFLAGS =  -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC
CC = gcc
NACL_SDK_VARIANT =
NACL_SDK_ROOT =
NACL_TOOLCHAIN =
target_os = linux
target_vendor = unknown
target_cpu = x86_64
target = x86_64-unknown-linux-gnu
host_os = linux-gnu
host_vendor = unknown
host_cpu = x86_64
host = x86_64-unknown-linux-gnu
RUBY_VERSION_NAME = ruby-2.0.0
RUBYW_BASE_NAME = rubyw
RUBY_BASE_NAME = ruby
build_os = linux-gnu
build_vendor = unknown
build_cpu = x86_64
build = x86_64-unknown-linux-gnu
RUBY_RELEASE_DATE = 2013-11-22
RUBY_PROGRAM_VERSION = 2.0.0
target_alias =
host_alias =
build_alias =
LIBS = -lpthread -lrt -ldl -lcrypt -lm
ECHO_T =
ECHO_N = -n
ECHO_C =
DEFS =
mandir = /usr/local/rvm/rubies/ruby-2.0.0-p353/share/man
localedir = /usr/local/rvm/rubies/ruby-2.0.0-p353/share/locale
libdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/lib
psdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/share/doc/ruby
pdfdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/share/doc/ruby
dvidir = /usr/local/rvm/rubies/ruby-2.0.0-p353/share/doc/ruby
htmldir = /usr/local/rvm/rubies/ruby-2.0.0-p353/share/doc/ruby
infodir = /usr/local/rvm/rubies/ruby-2.0.0-p353/share/info
docdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/share/doc/ruby
oldincludedir = /usr/include
includedir = /usr/local/rvm/rubies/ruby-2.0.0-p353/include
localstatedir = /usr/local/rvm/rubies/ruby-2.0.0-p353/var
sharedstatedir = /usr/local/rvm/rubies/ruby-2.0.0-p353/com
sysconfdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/etc
datadir = /usr/local/rvm/rubies/ruby-2.0.0-p353/share
datarootdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/share
libexecdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/libexec
sbindir = /usr/local/rvm/rubies/ruby-2.0.0-p353/sbin
bindir = /usr/local/rvm/rubies/ruby-2.0.0-p353/bin
exec_prefix = /usr/local/rvm/rubies/ruby-2.0.0-p353
PACKAGE_URL =
PACKAGE_BUGREPORT =
PACKAGE_STRING =
PACKAGE_VERSION =
PACKAGE_TARNAME =
PACKAGE_NAME =
PATH_SEPARATOR = :
SHELL = /bin/bash
archdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux
topdir = /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux
Activated Ruby gems
bundler => 1.3.5
Ruby load path ($LOAD_PATH)
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/x86_64-linux
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/vendor_ruby/2.0.0
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/vendor_ruby/2.0.0/x86_64-linux
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/vendor_ruby
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux
Ruby loaded libraries ($LOADED_FEATURES)
enumerator.so
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux/enc/encdb.so
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux/enc/trans/transdb.so
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux/rbconfig.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/compatibility.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/defaults.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/deprecate.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/errors.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/version.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/requirement.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/platform.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/basic_specification.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/stub_specification.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/exceptions.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/thread.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/monitor.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux/etc.so
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tmpdir.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/utils/tmpio.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/platform_info.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/platform_info/operating_system.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/platform_info/ruby.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/platform_info/binary_compatibility.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/buildout/ruby/ruby-2.0.0-x86_64-linux/passenger_native_support.so
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/native_support.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux/socket.so
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/socket.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/ruby_core_enhancements.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/utils/tmpdir.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/preloader_shared_helpers.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/public_api.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/debug_logging.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/loader_shared_helpers.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux/fcntl.so
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/constants.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/message_channel.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/utils.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/message_client.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/utils/unseekable_socket.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/request_handler/thread_handler.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/request_handler.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux/stringio.so
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/utils/tee_input.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/rack/thread_handler_extension.rb
/home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/lib/phusion_passenger/analytics_logger.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/path_support.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux/pathname.so
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/pathname.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/user_interaction.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/shared_helpers.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/gem_path_manipulation.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/gem_helpers.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/match_platform.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/rubygems_ext.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/version.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/settings.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux/digest.so
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/digest.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux/digest/sha1.so
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/set.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/definition.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/dependency.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/ruby_dsl.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/dsl.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/source.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/uri/common.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/uri/generic.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/uri/ftp.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/uri/http.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/uri/https.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/uri/ldap.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/uri/ldaps.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/uri/mailto.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/uri.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/timeout.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/protocol.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux/zlib.so
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http/exceptions.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http/header.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http/generic_request.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http/request.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http/requests.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http/response.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http/responses.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http/proxy_delta.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http/backward.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux/date_core.so
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/date/format.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/date.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/time.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/request.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/cgi/core.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/cgi/util.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/cgi/cookie.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/cgi.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/uri_formatter.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux/openssl.so
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/openssl/bn.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/openssl/cipher.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/openssl/config.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/openssl/digest.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/openssl/x509.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/openssl/buffering.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/openssl/ssl.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/openssl.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/securerandom.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/resolv.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/remote_fetcher.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/text.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/name_tuple.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-linux/strscan.so
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/source/path.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/source/git.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/lockfile_parser.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/lazy_specification.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/forwardable.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/spec_set.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/environment.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/index.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/remote_specification.rb
/usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/endpoint_specification.rb

Please provide questions. Thanks for the help. I will update this question with a better one because I don't know how to ask it.
Here is the gemset for that RVM path
rails@are-wedding:~$ rvm use ruby-2.0.0-p353@global
Using /home/rails/.rvm/gems/ruby-2.0.0-p353 with gemset global
rails@are-wedding:~$ gem list

*** LOCAL GEMS ***

bigdecimal (1.2.0)
bundler (1.3.5)
daemon_controller (1.1.7)
io-console (0.4.2)
json (1.7.7)
minitest (4.3.2)
passenger (4.0.27)
psych (2.0.0)
rack (1.5.2)
rake (10.1.0, 0.9.6)
rdoc (4.0.0)
test-unit (2.0.0.0)

I have asked a lot of people but I feel this problem is something to do with RVM. Anyway any help.
rake --version
rake, version 10.1.0

Here is the configuration information in the /etc/apache2/apache2.conf
   LoadModule passenger_module /home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27/buildout/apache2/mod_passenger.so
   PassengerRoot /home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.27
   PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-2.0.0-p353@global/ruby

A: The problem is that when you run the ruby command from the web server, it does not add /home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems to your GEM_PATH, only /usr/local/rvm/.../gems. Your rake gem is installed in /home/rails/.rvm/gems. You need to add /home/rails/.rvm/gems/ruby-2.0.0-p353@global/gems to GEM_PATH.

A: So after hours of working on this problem I found what it was created by. So here is how I solved it.
First problem was with the fact that I installed rvm incorrectly. I installed it under the rails user which resulted in some access problems. However this does not resolve the problem with the can't find the rake file. In order to fix this I had to start over. Because it was a cloud server starting over was easy. Just did a full rest and followed there few steps.
\curl -sSL https://get.rvm.io | bash
apt-get update
apt-get upgrade
apt-get install build-essential

rvm install ruby-2.0.0-p353
rvm ruby-2.0.0-p353@global --default --create
gem install passenger
passenger-install-apache2-module

Not all these steps are needed on some server depending on what is installed but in my case I wanted to make sure everything worked.
As you run the last command passenger-install-apache2-module you will see something like this. Just follow the instructions in my case I got this result.
Installation instructions for required software

 * To install Curl development headers with SSL support:
   Please run apt-get install libcurl4-openssl-dev or libcurl4-gnutls-dev, whichever you prefer.

 * To install Apache 2:
   Please install it with apt-get install apache2-mpm-worker

 * To install Apache 2 development headers:
   Please install it with apt-get install apache2-threaded-dev

 * To install Apache Portable Runtime (APR) development headers:
   Please install it with apt-get install libapr1-dev

 * To install Apache Portable Runtime Utility (APU) development headers:
   Please install it with apt-get install libaprutil1-dev

This was simple just followed the install steps and now I have apache running. After that you just run passenger-install-apache2-module again.
Everything should pass this time and we are on to the next step.
In my case the next step was to add this code to the /etc/apache2/apache2.conf.
   LoadModule passenger_module /usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.29/buildout/apache2/mod_passenger.so
   PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.29
   PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-2.0.0-p353@global/ruby

I just added it to the top really does not matter where you add it everything works.
after you have done that make a new ruby on rails application with these steps
rvm use rvm ruby-2.0.0-p353@test --create
gem install rails
gem install bundler
rails new tester
cd tester

After which you need to create a new sites-avaliable.Mine looks like this.
root@rails-app:/etc/apache2/sites-enabled# cat /etc/apache2/sites-available/test.conf
   <VirtualHost *:80>
      ServerName www.something.com
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot /home/rails/apps/tester/public
      <Directory "/home/rails/apps/tester/public">
         # This relaxes Apache security settings.
         AllowOverride all
         # MultiViews must be turned off.
         Options -MultiViews
     Require all granted
         Order allow,deny
         Allow from all
      </Directory>
   </VirtualHost>

Run this to restart and add test
sudo a2ensite test && sudo service apache2 restart

Found out that if you don't have the Require all granted it will send you a error message that looks something like this in the error log. Not total sure if you need any of the others like Allow from all but I added them anyway. Here is some extra documentation on this error if you want some more reading Wiki Apache Org
[client 75.1.169.97:51729] AH01797: client denied by server configuration: /home/rails/apps/tester/public/

oh if you were wondering the error log is located in /var/log/apache2/
After which it got me back to the error I noted above
So here is how I fixed can't find the Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound).
first thing you need to do is simple just created .ruby-version and .ruby-gemset here is what mine look like.
rails@rails-app:~/apps/tester$ cat .ruby-version
ruby-2.0.0-p353
rails@rails-app:~/apps/tester$ cat .ruby-gemset
test

after that you need to add this file into your config folder
# config/setup_load_paths.rb
 if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
  begin
    rvm_path     = File.dirname(File.dirname(ENV['MY_RUBY_HOME']))
    rvm_lib_path = File.join(rvm_path, 'lib')
    # $LOAD_PATH.unshift rvm_lib_path
    require 'rvm'
    RVM.use_from_path! File.dirname(File.dirname(__FILE__))
  rescue LoadError
    # RVM is unavailable at this point.
    raise "RVM ruby lib is currently unavailable."
  end
end

ENV['BUNDLE_GEMFILE'] = File.expand_path('../Gemfile', File.dirname(__FILE__))
require 'bundler/setup'

This is a bit of magic here but was it is doing is changing the default rvm gemset for passenger. However if your using capistrano you can use rvm-capistrano. However you have to use older version of capistrano. Capistrano 3 does not work with rvm-capistrano.
If this does not work for you might be how you have it set up. Anyway hope that helps.

A: Your problem is that you added an additional gem that has unresolved dependencies. Run bundle update to update your dependencies and you should be good to go.

A: I had this exact Passenger message and resolved it with this solution from Brian Armstrong: Bundler installing gems in wrong location
(run bundle install --system).

A: That's a lot more hassle than needbe. All you really had to do was reset your gemsets: https://github.com/phusion/passenger/wiki/Resetting-RVM-gemsets
rvm gemset empty
or before rvm use whateveryourgemset
Basically you can list all active gemsets, empty them all, then install passenger into the correct one by installing your bundle again from the application folder. Problem solved.


text:
Q: No suitable constructor found for type [simple type, class com…Deadline]: can not instantiate from JSON object I have been fighting with getting my test data loader working with one element in my test json file.  I have tried adding default constructors and multitude of different ways around this but have reached the point where I need help.

The exception: Failed: No suitable constructor found for type [simple
  type, class com…Deadline]: can not instantiate from JSON object
  (missing default constructor or creator, or perhaps need to add/enable
  type information?)\n at [Source:
  sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream@1d7041fb;
  line: 14, column: 4] (through reference chain:
  java.util.ArrayList[0]->com….core.domain.representation.AdmissionsRepresentation[\"deadlines\"]->java.util.ArrayList[0])"}

The json looks like this:
[
      {
       "id" : "d5b6754a-f8aa-49e5-8e8c-d3f7ad0df2e3",
        "rec" : 5153,
        "acc" : 1389,
        "app" : 12,
        "rate" : 66,
        "sat" : 2100,
        "act" : 31,
        "gpa" : 4.0,
        "deadlines" : [
            {
                "type" : "Priority",
                "day" : "1",
                "month" : "3"
            },
            {
                "type" : "General",
                "day" : "15",
                "month" : "7"
            }
        ]
      },
      {
       "id" : "d5b6754a-f8aa-49e5-8e8c-d3f7ad0df2e3",
        "rec" : 5153,
        "acc" : 1389,
        "app" : 12,
        "rate" : 66,
        "sat" : 2100,
        "act" : 31,
        "gpa" : 4.0,
        "deadlines" : [
            {
                "type" : "Priority",
                "day" : "1",
                "month" : "3"
            },
            {
                "type" : "General",
                "day" : "15",
                "month" : "7"
            }
        ]
      }
    ]

Snippets of the two classes referred to in the error

public class AdmissionsRepresentation {
    private String id;
    private String created;
    private String lastModified;
    private List<Deadline> deadlines = new ArrayList<>();

  public AdmissionsRepresentation() {

  }

    public AdmissionsRepresentation(Admissions admissions) {
        this();
        fromDomain(admissions);
    }

    ....

    public void fromDomain(Admissions admissions) {
        setId(admissions.collegeId());

        List<Deadline> dl = admissions.deadlines();
        for (int i = 0; i < dl.size(); i++) {
            deadlines.add(dl.get(i));
        }
    }

    public Admissions toDomain() {
        ArrayList<Deadline> domainDeadlines = new ArrayList<Deadline>();
        for (int i = 0; i < deadlines.size(); i++) {
            domainDeadlines.add(deadlines.get(i));
        }

        Admissions admissions = null;
        admissions = new AdmissionsBuilder().setId(this.id)...
  .setDeadlines(domainDeadlines).build();
        return admissions;
    }

    public class Deadline implements Serializable {
        private static final long serialVersionUID = 1L;
        // private Type type;
        private String type;
        private String label;
        private String day;
        private String month;

        /*
         * public enum Type {

         * }
         */
        //NOTE: I have tried removing this constructor and it seems to make no difference.
        public Deadline() {

        }

        public Deadline(String type, String day, String month) {
            this.type = type;
            this.day = day;
            this.month = month;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            System.out.println("setting type");
            System.out.println("type: " + type.toString());
            this.type = type;
            // this.type = Type.valueOf(type);
        }
    }


text:
Q: In C++, how to return different generic types depending on argument in a class? I have this code:
template<class T1, class T2>
class Pair
{
private:
    T1 first;
    T2 second;

public:
    void SetFirst(T1 first)
    {
        this.first = first;
    }
    void SetSecond(T2 second)
    {
        this.second = second;
    }
    T1 GetFirst()
    {
        return first;
    }
    T2 GetSecond()
    {
        return second;
    }
};

How could I implement two single methods SetValue() and GetValue(), instead of the four I have, that decides depending on parameters which generic type that should be used? For instance I'm thinking the GetValue() method could take an int parameter of either 1 or 2 and depending on the number, return either a variable of type T1 or T2. But I don't know the return type beforehand so is there anyway to solve this?

A: Not sure to understand what do you want and not exactly what you asked but...
I propose the use of a wrapper base class defined as follows
template <typename T>
class wrap
 {
   private:
      T  elem;

   public:
      void set (T const & t)
       { elem = t; }

      T get () const
       { return elem; }
 };

Now your class can be defined as
template <typename T1, typename T2>
struct Pair : wrap<T1>, wrap<T2>
 {
   template <typename T>
   void set (T const & t)
    { wrap<T>::set(t); }

   template <typename T>
   T get () const
    { return wrap<T>::get(); }
 };

or, if you can use C++11 and variadic templates and if you define a type traits getType to get the Nth type of a list,
template <std::size_t I, typename, typename ... Ts>
struct getType
 { using type = typename getType<I-1U, Ts...>::type; };

template <typename T, typename ... Ts>
struct getType<0U, T, Ts...>
 { using type = T; };

you can define Pair in a more flexible way as follows
template <typename ... Ts>
struct Pair : wrap<Ts>...
 {
   template <typename T>
   void set (T const & t)
    { wrap<T>::set(t); }

   template <std::size_t N, typename T>
   void set (T const & t)
    { wrap<typename getType<N, Ts...>::type>::set(t); }

   template <typename T>
   T get () const
    { return wrap<T>::get(); }

   template <std::size_t N>
   typename getType<N, Ts...>::type get ()
    { return wrap<typename getType<N, Ts...>::type>::get(); }
 };

Now the argument of set() can select the correct base class and the correct base element
   Pair<int, long>  p;

   p.set(0);  // set the int elem
   p.set(1L); // set the long elem

otherwise, via index, you can write
   p.set<0U>(3); // set the 1st (int) elem
   p.set<1U>(4); // set the 2nd (long) elem

Unfortunately, the get() doesn't receive an argument, so the type have to be explicited (via type or via index)
   p.get<int>();  // get the int elem value
   p.get<long>(); // get the long elem value

   p.get<0U>(); // get the 1st (int) elem value
   p.get<1U>(); // get the 2nd (long) elem value

Obviously, this didn't work when T1 is equal to T2
The following is a (C++11) full working example
#include <iostream>

template <std::size_t I, typename, typename ... Ts>
struct getType
 { using type = typename getType<I-1U, Ts...>::type; };

template <typename T, typename ... Ts>
struct getType<0U, T, Ts...>
 { using type = T; };

template <typename T>
class wrap
 {
   private:
      T  elem;

   public:
      void set (T const & t)
       { elem = t; }

      T get () const
       { return elem; }
 };

template <typename ... Ts>
struct Pair : wrap<Ts>...
 {
   template <typename T>
   void set (T const & t)
    { wrap<T>::set(t); }

   template <std::size_t N, typename T>
   void set (T const & t)
    { wrap<typename getType<N, Ts...>::type>::set(t); }

   template <typename T>
   T get () const
    { return wrap<T>::get(); }

   template <std::size_t N>
   typename getType<N, Ts...>::type get ()
    { return wrap<typename getType<N, Ts...>::type>::get(); }
 };

int main()
 {
   //Pair<int, int>  p;  compilation error
   Pair<int, long, long long>  p;

   p.set(0);
   p.set(1L);
   p.set(2LL);

   std::cout << p.get<int>() << std::endl;       // print 0
   std::cout << p.get<long>() << std::endl;      // print 1
   std::cout << p.get<long long>() << std::endl; // print 2

   p.set<0U>(3);
   p.set<1U>(4);
   p.set<2U>(5);

   std::cout << p.get<0U>() << std::endl; // print 3
   std::cout << p.get<1U>() << std::endl; // print 4
   std::cout << p.get<2U>() << std::endl; // print 5
 }

A: C++ is statically typed, so the argument given must be a template-argument instead a function-argument.
And while it will look like just one function each to the user, it's really two.
template <int i = 1> auto GetValue() -> std::enable_if_t<i == 1, T1> { return first; }
template <int i = 2> auto GetValue() -> std::enable_if_t<i == 2, T2> { return second; }
template <int i = 1> auto SetValue(T1 x) -> std::enable_if_t<i == 1> { first = x; }
template <int i = 2> auto SetValue(T2 x) -> std::enable_if_t<i == 2> { second = x; }

I use SFINAE on the return-type to remove the function from consideration unless the template-argument is right.

A: For this particular situation, you should definitely prefer std::pair or std::tuple.
You can simply overload SetValue() (provided T1 and T2 can be distinguished, if not you have a compile error):
void SetValue(T1 x)
{ first=x; }

void SetValue(T2 x)
{ second=x; }

Then, the compiler with find the best match for any call, i.e.
Pair<int,double> p;
p.SetValue(0);    // sets p.first
p.SetValue(0.0);  // sets p.second

With GetValue(), the information of which element you want to retrieve cannot be inferred from something like p.GetValue(), so you must provide it somehow. There are several options, such as
template<typename T>
std::enable_if_t<std::is_same<T,T1>,T>
GetValue() const
{ return first; }

template<typename T>
std::enable_if_t<std::is_same<T,T2>,T>
GetValue() const
{ return second; }

to be used like
auto a = p.GetValue<int>();
auto b = p.GetValue<double>();

but your initial version is good enough.


text:
Q: Add bcc to new order form for woocommerce How can I add BCC or CC to the woo commerce, new order email?
I think this is the code that is running the new order emails: http://codepad.org/kPTpSIM0
I cant seem to find what I need on Google.
Thank you in advance.
I found this but I do not know where it goes:

add_filter( 'woocommerce_email_headers', 'add_bcc_all_emails', 10, 2);

function add_bcc_all_emails($headers, $object) {

$headers = array();
$headers[] = 'Bcc: Name <me@email.com>';
$headers[] = 'Content-Type: text/html';

return $headers;
}

A: Well it looks like you have already read this answer as that is the recommended code, though I believe it will add the BCC on all emails and not just new orders.
Instead I would suggest the following:
add_filter( 'woocommerce_email_headers', 'add_bcc_all_emails', 10, 3);

function add_bcc_all_emails( $headers, $email_id, $order ) {

    if( 'new_order' == $email_id ){
        $headers .= "Bcc: Name <me@email.com>" . "\r\n";
    }

    return $headers;
}

As for "where the code goes", it should be made into a plugin. Depending on how easily you would like to be able to disable this code in the future you could write it as a regular plugin (disable from Plugins overview) or as a site-specific snippets plugin (permanent until you delete file via FTP).

A: Found a templorary fix, It's not a BCC or CC, but It seems I can add more than 1 recipient to the email by comma separating the addresses.
would still like to do BCC or CC as well though, if anyone knows how.


text:
Q: Is there anyway to bind a command to all instances of a button in a user control in XAML / WPF / MVVM My problem is that I have a lot of code doing the same thing. All the buttons in my stackpanel trigger a command and with that command I want to send a parameter to a method in my view model.
I have the following XAML code, as you can see it is ridiculously repetitive:
<StackPanel x:Name="Row" Grid.Row="4">
    <Button Content="z"
        Command="{Binding ButtonClickCommand}"
        CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" />
    <Button Content="x"
        Command="{Binding ButtonClickCommand}"
        CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" />
    <Button Content="c"
        Command="{Binding ButtonClickCommand}"
        CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" />
    <Button Content="v"
        Command="{Binding ButtonClickCommand}"
        CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" />
    <Button Content="b"
        Command="{Binding ButtonClickCommand}"
        CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" />
    <Button Content="n"
        Command="{Binding ButtonClickCommand}"
        CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" />
    <Button Content="m"
        Command="{Binding ButtonClickCommand}"
        CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}" />
</StackPanel>

Is there a way I can reduce the amount of repetitive code, either in the XAML or View Model?
Thanks in advance

A: Simple solution that works, assuming you have buttons and command binding done at one place or else the first answer (seen the answer after my post) gives you easiest way by putting under an ItemsControl and do the stuff.
   <StackPanel x:Name="Row" Grid.Row="4">
              <StackPanel.Resources>
                  <Style TargetType="{x:Type Button}">
                      <Setter Property="Command" Value="{Binding ButtonClickCommand}" />
                      <Setter Property="CommandParameter" Value="{Binding RelativeSource={RelativeSource Self}, Path=Content}"
  />
                  </Style>
              </StackPanel.Resources>
              <Button Content="z"  />
              <Button Content="x"  />
              <Button Content="c"  />
              <Button Content="v"  />
              <Button Content="b"  />
              <Button Content="n"  />
              <Button Content="m"  />
          </StackPanel>

Hope this helps you :)

A: Create a list of items in your ViewModel, for example
public IEnumerable<string> Values { get; set; } = new List<string> { "x", "c", "v", "..." };

And assign it to the ItemsControl
<ItemsControl x:Name="Row" Grid.Row="4" ItemsSource="{Binding Values}">
    <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <StackPanel/>
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
    <ItemsControl.ItemTemplate>
        <DataTemplate>
            <Button Content="{Binding }"
                Command="{Binding Path=DataContext.ButtonClickCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
                CommandParameter="{Binding }"/>
        </DataTemplate>
    </ItemsControl.ItemTemplate>
</ItemsControl>

ItemsControl.ItemsPanel says what container to use for these items and ItemTemplate defines what each element of StackPanel should look like.
Binding inside DataTemplate refers to string that's why in order to get to the ButtonClickCommand we have to go back to ItemsControl's context.


text:
Q: .htaccess rule help in a plex non-windows hosting environment I'm having trouble writing a rule for .htaccess which will redirect HTML to PHP. I'm using 302 until I get it to work right - then I'll change to a 301. I found several postings that describe this, but I am having problems - possibly because I'm running a hosting package, and each client is in a virtual/subfolder (sorry for poor description of hosting environment).
The rule I am using is
...
RewriteEngine on
RewriteRule ^(.*).html$ $1.php [R=302]
...
When I try to go to https://dmcelebratealife.com/index.html I get a 404 message saying:
https://www.dmcelebratealife.com/var/www/vhosts/dmcelebratealife.com/public_html/index.php

A: I added the following and it seemed to work for me.
RewriteEngine on
RewriteRule ^(.*)\.html$ /$1.php [R=302]

A: This works for me and is domain-independent.
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^(?!.+\.\w{2,4})(.+)$ $1.php [L]
RewriteCond %{DOCUMENT_ROOT}/$1.html -f
RewriteRule ^(?!.+\.\w{2,4})(.+)$ $1.html [L]

The first two redirect to the php file if it exists.  If it doesn't then the second two will try for an HTML file.
Note it doesn`t use a 302 as you don't want to tell the user what you are doing.  This does an internal redirect.
This means that if the user types in
https://www.example.com/test
it will remain in the URL box, but the following file will be executed
https://www.example.com/test.php


text:
Q: Neo4J conditional formatting of a string attribute from a set of boolean attributes I have a node with the following attributes :
MyNode
  stage_1: boolean
  stage_2: boolean
  stage_3: boolean

I'd like to create a query that generate a macro_step string attribute, that is conditionnally filled by the values of the booleans. For instance, if stage_1 and stage_3 were true but stage_2false, I would like MyNode.macro_steps to be filled with "STAGE_1 STAGE2"
I tried the following but it doesn't work :
match (mo:MyNode)
mo.macro_steps = ""
case
  when mo.stage_1 then mo.macro_steps += "STAGE_1\n"
  when mo.stage_2 then mo.macro_steps += "STAGE_2\n"
  // etc.
  else null
end
return mo

How can I achieve this ?

A: Try this:
MATCH (n:MyNode)
WITH n,
reduce(str = '', propertyKey IN keys(properties(n)) |
CASE WHEN n[propertyKey] = true THEN str + toUpper(propertyKey) + " "
     WHEN n[propertyKey] = false THEN str + toUpper(replace(propertyKey, '_', '')) + " "
     ELSE str END) AS macro_steps
SET n.macro_steps = trim(macro_steps)
RETURN n

For the node, created by:
MERGE (r:MyNode{sample_1: true, sample_2: true, sample_3: false})

The first query gives:
╒══════════════════════════════════════════════════════════════════════╕
│"n"                                                                   │
╞══════════════════════════════════════════════════════════════════════╡
│{"sample_1":true,"sample_2":true,"sample_3":false,"macro_steps":"SAMPL│
│E_1 SAMPLE_2 SAMPLE3"}                                                │
└──────────────────────────────────────────────────────────────────────┘

As suggested by @nimrodserok, in the comments, if you only want true valued property keys, then this is the query:
MATCH (n:MyNode)
WITH n,  reduce(str = '', propertyKey IN keys(properties(n)) |
CASE WHEN n[propertyKey] = true THEN str + toUpper(propertyKey) + ' '
     ELSE str END) AS macro_steps
SET n.macro_steps = trim(macro_steps)
RETURN n

The output is:
{"stage_1":true,"stage_2":false,"stage_3":true,"macro_steps":"STAGE_1 STAGE_3"}


text:
Q: What changes should be done in the algorithm/ MATLAB code to detect vehicles in proper shape? I am working on a project in image processing which is based on importance of phase only reconstruction of a signal obtained using Fourier transform.For more information about phase only reconstruction,you can see the answer given by geometrikal in the link.
Now ,I have detected moving objects from the video of Traffic on road taken using stationary camera ( Please download  the 1.47 MB video for testing MATLAB Code by ( step1) click on the play button then (step2) right clicking on video then ( step3 ) click on save as option )
Algorithm No. 1
The proposed approach
Requirement: An input image sequence I(x, y, n) (where x and y are image dimensions and n represent frame number in a video) which is extracted from video.
Outcome: The segmentation mask of moving object for each frame

*

*For each frame in a input video perform step 2, append step 2 result in resultant array 'I(x, y, n)'

*Smoothen the current frame using 2D Gaussian filter

*Perform 3D FFT for the whole sequence I(x, y, n) using (Eq.4.1)

*Calculate the phase spectrum using the real and imaginary parts of 3D DFT

*Calculate the reconstructed sequence Î(x, y, n) using (Eq.4.2)

*For each frame in a input video perform step 7 to step 10 to get segmentation mask for each frame and append step 10 result in resultant segmentation mask array BW(x,y,n)'

*Smooth the reconstructed frame of Î(x, y, n) using the averaging filter.

*Compute the mean value of the current frame

*Convert the current frame into binary image using mean value as the threshold

*Perform morphological processing, i.e., filling and closing, to obtain segmented mask of moving objects for the current frame

*End algorithm.

If you run my MATLAB code, you can observe that I am quite successful in detecting all the moving objects in each video frames. But now I want to detect only one moving object at a time from current frame and avoid other moving objects by making changes in the same code or algorithm .But  don't understand how it can be done.
so can anybody tell me
What changes should be done in the algorithm/ MATLAB code to do single vehicle tracking ?
NOTE : If you are getting problems to reach to links for equation4.1 and equation4.2 of algorithm, please follow the equations from the paper
UPDATE: As per Hugh Sir's suggestion, i should try to label the moving object so that tracking is possible. But while labelling the main difficulty is : after running the above MATLAB code, one will see that the segmented frames which I obtained after morphological processing are not "properly filled". So I couldn't label them. One can crosscheck it by observing the segmented mask which is in binary image form

    tic
clc;
clear all;
close all;

%read video file
video = VideoReader('D:\dvd\Matlab code\test videos\5.mp4');

T= video.NumberOfFrames  ;           %number of frames%

frameHeight = video.Height;          %frame height

frameWidth = video.Width ;           %frameWidth

get(video);                          %return graphics properties of video

i=1;

for t=300:15:550  %select frames between 300 to 550 with interval of 15 from the video
    frame_x(:,:,:,i)= read(video, t);
    frame_y=frame_x(:,:,:,i);

    %figure,
    %imshow(f1),title(['test frames :' num2str(i)]);
    frame_z=rgb2gray(frame_y);                 %convert each colour frame into gray

    frame_m(:,:,:,i)=frame_y; %Store colour frames in the frame_m array

    %Perform Gaussian Filtering
    h1=(1/8)*(1/8)*[1 3 3 1]'*[1 3 3 1]  ;   % 4*4 Gaussian Kernel
    convn=conv2(frame_z,h1,'same');

    g1=uint8(convn);

    Filtered_Image_Array(:,:,i)=g1; %Store filtered images into an array
    i=i+1;
end

%Apply 3-D Fourier Transform on video sequences
f_transform=fftn(Filtered_Image_Array);

%Compute phase spectrum array from f_transform
phase_spectrum_array =exp(1j*angle(f_transform));

%Apply 3-D Inverse Fourier Transform on phase spectrum array and
%reconstruct the frames
reconstructed_frame_array=(ifftn(phase_spectrum_array));

k=i;

i=1;
for t=1:k-1

    %Smooth the reconstructed frame of Î(x, y, n) using the averaging filter.
    Reconstructed_frame_magnitude=abs(reconstructed_frame_array(:,:,t));
    H = fspecial('disk',4);
    circular_avg(:,:,t) = imfilter(Reconstructed_frame_magnitude,H);

    %Convert the current frame into binary image using mean value as the threshold
    mean_value=mean2(circular_avg(:,:,t));
    binary_frame = im2bw(circular_avg(:,:,t),1.6*mean_value);

    %Perform Morphological operations
    se = strel('square',3);
    morphological_closing = imclose(binary_frame,se);
    morphological_closing=imclearborder(morphological_closing); %clear noise present at the borders of the frames

    %Superimpose segmented masks on it's respective frames to obtain moving
    %objects
    moving_object_frame = frame_m(:,:,:,i);
    moving_object_frame(morphological_closing) = 255;
    figure,
    imshow(moving_object_frame,[]), title(['Moving objects in Frame :' num2str(i)]);

 i=i+1;
end
toc


text:
Q: Perfect subset sum problem with limit on subset size Currently, I implemented the perfect subset sum problem using the implementation provided on geeksfor geeks (1, java implementation). The number of subsets with sum=k increases exponentially with the set size from which the subsets are taken. As I consider the subsets in increasing size, I would like to be able to first generate all subsets with size n, then all subsets with size n+1, etc. This way, if some criteria is not satisfied for size n, I would no longer have to generate all subsets with size n+1.
The question remains how to efficiently generate all subsets with sum k and size n only. I have check several threads here on stackoverflow, but none gave me a useful and insightful approach.
Any suggestions would be more than welcome!


text:
Q: NSMutableDictionary is null after init I have a method that creates a new NSMutableDictionary, sets some objects and then returns that dictionary with an autorelease like so:
NSMutableDictionary* parameters = [NSMutableDictionary new];

[parameters setObject:@"banana" forKey:@"fruit"];
[parameters setObject:@"potato" forKey:@"vegetable"];
[parameters setObject:@"water" forKey:@"drink"];

return [parameters autorelease];

Everything works but when I set a breakpoint before I return the parameters pointer, and want to see what's inside with gdb by using print object it shows me the objects. But when I want to access the count it fails and tells me that it does not point to a valid object?
(gdb) po parameters
{
drink = water;
fruit = banana;
vegetable = potato;
}

(gdb) po [parameters count]
0x3 does not appear to point to a valid object.

What is going on?

A: Just type p [parameters count].
po can only used for Objective-C objects (it means print object). The count is an integer, which is not an Objective-C object.

A: You are using po with the dictionary count as argument. So GDB is actually trying to print an object located at memory address 3 (the count).
Your dictionary is fine.
If you want to print the count value, use p instead of po.