Posts

csv - Assigning multiple variables in matlab from one matrix -

i need write csv have more 1 output not know how either or assign each number separate variable , have print in list csv file. x=rand(10); rows=[1:10]; cols=[1:10] j=x(rows,cols) end end csvwrite('weikle_list1.csv',j); y=csvread('weikle_list1.csv') cols=[1:10] rows=[1:10] k=x(cols,rows) end end csvwrite('weikle_list2.csv',k); w=csvread('weikle_list2.csv') formatspec='k=%1.4f'; fprintf(formatspec,x);

c++ - Ambiguous constructor -

well, i'm newbie c++ , practicing constructors. i'm creating bad version of string class , have been asked next task: a) create constructor can make conversion const char* string . b) create constructor 'n' first letters const char* . if 'n' longer const char* , copy of const char* written string . if 'n == 0', program write empty string . i think had no problems implementing them; have: cadena::cadena(const char* cad){ tam_ = strlen(cad); s_ = new char[tam_ + 1]; strcpy(s_,cad); } cadena::cadena(const char* cad, unsigned lon){ tam_ = lon; s_ = new char[tam_ + 1]; for(unsigned = 0; < tam_; i++){ s_[i] = cad[i]; } s_[tam_] = '\0'; } my problem comes when try test them in main method, error: "c1 ambiguous". i tried making dummy parameter (declaring unsigned parameter int no name in header) initizialite second parameter 0 , can't make using dummy parameter. i know...

YouTube and FancyBox Video Functionality -

i trying embed youtube video in actual page, , have video in lightbox using fancybox plugin. when this, get: refused display 'youtube video url' in frame because set 'x-frame-options' 'sameorigin'. i video on page autoplay, , video in lightbox play when clicked , pause video embedded on page. appreciated in solving this, haven't worked youtube api or fancybox. edit: i able embed 2 videos, 1 on page , 1 in lightbox of this: embed youtube video - refused display in frame because set 'x-frame-options' 'sameorigin' in case, needs question answered in future. changing url watch embed allows this. anyone able on play/stop functionality using fancybox? thanks! i able embed 2 videos, 1 on page , 1 in lightbox of this: embed youtube video - refused display in frame because set 'x-frame-options' 'sameorigin' in case, needs question answered in future. changing url watch embed allows this.

makefile - How should I link libraries in automake normally linked with pkg-config? -

i'm trying project buildable automake. while using allegro5. i can build code using following command fine g++ -std=c++0x *.cpp -o mygame $(pkg-config --libs allegro-5.0 \ allegro_acodec-5.0 allegro_audio-5.0 allegro_color-5.0 allegro_dialog-5.0 \ allegro_font-5.0 allegro_image-5.0 allegro_main-5.0 allegro_memfile-5.0 \ allegro_physfs-5.0 allegro_primitives-5.0 allegro_ttf-5.0) but makefile not work. here src/makefile.am bin_programs = mygame am_cxxflags = "-std=c++0x" mygame_sources = animation.cpp body.cpp gameobject.cpp menu.cpp vector3.cpp \ arena.cpp button.cpp keyboard.cpp mesh.cpp assets.cpp character.cpp \ main.cpp mouse.cpp barrier.cpp environment.cpp manager.cpp titlemenu.cpp mygame_ldadd = allegro-5.0 allegro_acodec-5.0 allegro_audio-5.0 \ allegro_color-5.0 allegro_dialog-5.0 allegro_font-5.0 allegro_image-5.0 \ allegro_main-5.0 allegro_memfile-5.0 allegro_physfs-5.0 \ allegro_primitives-5.0 allegro_ttf-5.0 cleanfiles = myg...

Java Collections Binary Search : The method binarySearch in the type Collections is not applicable for the arguments -

i trying design ride sharing system. here base object package rider; import java.util.treemap; public class uber{ string driver; treemap<float,string> destination; public uber(string d) { driver=d; destination = new treemap<float,string>(); } private void addtimedest(float tm, string dest) { destination.put(tm, dest); } float gettsum() { float tsum=0; (float f : this.destination.keyset()) tsum+=f; return tsum; } } so, each object has driver , associated time<->destination map driver. ultimately, want sort list of such objects time field i.e. key of treemap. and here iterator class created above package rider; import java.util.arraylist; import java.util.collections; import java.util.comparator; import java.util.iterator; public class uberiterator implements iterator<uber> { int currindex=0; arraylist<uber> ulist; comparato...

r - Extract time from timestamp? -

essentially, want hour, minute, , seconds column of timestamps have in r, because want view how different data points occur throughout different times of day , day , date irrelevant. however, how timestamps structured in dataset: 2008-08-07t17:07:36z and i'm unsure how time timestamp. thank can provide , please let me know if can provide more information! we can use strptime convert datetime class , format extract hour:min:sec. dtime <- strptime(str1, "%y-%m-%dt%h:%m:%sz") format(dtime, "%h:%m:%s") #[1] "17:07:36" if op wants have hour, min, sec separate columns read.table(text=format(dtime, "%h:%m:%s"), sep=":", header=false) # v1 v2 v3 #1 17 7 36 another option using lubridate library(lubridate) format(ymd_hms(str1), "%h:%m:%s") #[1] "17:07:36" data str1 <- "2008-08-07t17:07:36z"

xaml - Select a different grid based on a converter's value for a UWP app -

in uwp app, have property returns 3 values. want show different grid based on value using converter. best way achieve this? direction think going head towards create 3 different grid templates, , set style 1 of these 3 templates based on converter returns. know if work? grid doesn have grid, can contentcontrol or that. want show different section of ui based on property thanks i use windowsstatetriggers nuget package. once installed can reference @ top of xaml xmlns:triggers="using:windowsstatetriggers" and had property in backend class called isbusy public bool isbusy { get; set; } = false; and example had 2 simple grids in xaml. <stackpanel x:name="root"> <grid x:name="redgrid" background="red" width="200" height="100" /> <grid x:name="greengrid" background="green" width="200" height="100" visibility="collapsed"/> </sta...