Posts

mysql - SQL commands not compliable by H2 -

the following sql commands mysql. not sql expert , not know h2. spring app throws exception because user_roles table can not created. has problem fk_username_idx : drop table if exists users; drop table if exists user_roles; create  table users (   userid varchar(5) not null,   username varchar(45) not null ,   password varchar(60) not null ,   enabled tinyint not null default 1 ,   primary key (userid));     create table user_roles (   user_role_id int(11) not null auto_increment,   userid varchar(5) not null,   role varchar(45) not null,   primary key (user_role_id),   unique key uni_username_role (role,userid),   key fk_username_idx (userid),   constraint fk_username foreign key (userid) references users (userid)); error log: caused by: org.h2.jdbc.jdbcsqlexception: unbekannter datentyp: "fk_username_idx" unknown data type: "fk_username_idx"; sql statement:    create table user_roles (   user_role_id int(11) not null auto_increment,   userid v...

c++ - Cannot use Boost Library in Xcode IDE project/workspace? -

it seems have done humanly possible incorporate boost xcode c++ workspace, derived project. here have done: terminal "sudo port install boost" -> boost header located in /opt/local/include/ , dylibs located in /opt/local/lib. then "#include "boost/multi_array.hpp" 1 of files, went target settings, set "search header paths" settings /opt/local/include. did not work. xcode redlighted #include "file not found." looked @ couple youtube videos, did not @ all. figured might try "link binary libraries" option , copied libboost math dylibs workspace. still did not work. i know missing file issue due incorrect path, tried changing location setting through options "relative group or workspace or developer directory", effort no avail. reinstalled xcode, , problem still persists. any tips or suggestions greatly, , use word truest sincerity, appreciated. :) replace double-quotes in include line greater- , les...

javascript - NBA Draft Lottery remove array item after it is revealed upon button click -

https://jsfiddle.net/7jux5rlx/3/ ? full code above i'm trying make random nba draft lottery 8 teams (using array 8 images) reveals image of team 8th pick on button click , removes array list leaving 7 remaining teams , on. i dont want remove image , item option array when click following 7 buttons. trying use 8 list images in array, , 8 buttons numbered 1-8. want similar nba's draft lottery if has code formula percentages great. the odds each team chances 1st pick = 25%, 2nd pick 16.4%, 3rd pick 16.4%, 4th pick 16.3%, 5th pick 9.4%, 6th pick 6.6%, 7th pick 4.4%, 8th pick 2.7%, here have now. can't seem button reveal random team. fantasy league not professional site or anything. function teams() { var ateams = []; ateams[0] = "<img src='http://i.imgur.com/kowpajr.png' height='100' width='100' alt='cavs'>"; ateams[1] = "<img src='http://i.imgur.com/kowpajr.png' height='100' width='1...

kvm - Instance created by CloudStack not opening its console -

after creating instance cloudstack ui, can see vms: # virsh list --all id name state ---------------------------------------------------- 1 v-2-vm running 4 s-1-vm running 5 r-4-vm running 8 i-2-5-vm running 10 i-2-3-vm running but when try start console instance i-2-5-vm, following: # virsh console i-2-5-vm connected domain i-2-5-vm escape character ^] hereafter console hangs, not command prompt comes. have press ctrl+] come shell. additional information: # virsh ttyconsole i-2-5-vm /dev/pts/4 i can ping it, cannot ssh. please let me know, how can login instance ? start console cloudstack gui rather command line.

Use external function in R shiny -

i call function shiny server module. actual function complex i'm putting simple example here. want call "callfunction" server part calculations. error message: "cannot coerce type 'closure' vector of type 'character'" callfunction = function(one,two) { #write.csv(buildpath, file = "test.csv") res= paste(one,two,sep = "") return(res) } library(shiny) ui = fluidpage( titlepanel("mind map", windowtitle = "mind map"), textinput(inputid = "username", label = "enter username"), textinput(inputid = "contact1", label = "contact 1"), #submit button actionbutton("submitact", label = "go!!"), textoutput("texty") ) server = function(input, output){ p1 <- eventreactive(input$submitact, { input$username }) p2 <- eventreactive(input$submitact, { input$contact1 ...

scala - Recommender System using ALS from ML -

i have made research , know there 2 possible ways create recommender system using apache spark , 1 way using mllib comes pretty nice example , have tried , easy, on other hand can use als ml . feel pretty comfortable working rdd s, nevertheless i'm trying use dataframes more regularly gain more experience. to practice, started using crazy data ratings normalized, , have on 4000+ records 5 possible products (as below). first challenge how convert dataframe required structure; structure guessed after several hours reading source code. val df = sqlcontext.createdataframe(sc.parallelize(list(row(0.0, 0.12, 0.1, 0.0, 0.16), row(0.1, 0.0, 0.3, 0.52, 0.67))), structtype(structfield("product1", doubletype, true) :: structfield("product2", doubletype, true) :: structfield(...

How to insert text in between texts in Textbox VB6/VBA -

i wanted insert texts(new line) in between existing texts in textbox (multiline = true). example: (textbox1.text's value written below) name: name of client dob: 11/11/11 >>>this insert value of textbox2.text hospitalization: no serial number: 12345678 private sub cmdtransfer_click() dim searchnote integer, searchthis string, tx2 string if cb9.value = true tx2 = "address: " & vbtab & text2.text & vbcrlf end if searchthis = "hospitalization" searchnote = instr(textbox1.text, searchthis) if searchnote textbox1 .setfocus .selstart = searchnote .text = .text & .selstart & tx2 end end if end sub what i'm doing in code i'm getting number of characters before "hospitalization" can insert value of textbox2 before it. dont know how tho. please help. thanks! i believe code looking this: left(searchnote, instr(1, s...