Posts

mysql - Replace the id's with name using single query -

select team_with.participant1,team_with.participant2,team_with.participant3 event,team_with team_with.for_event_no=event.event_no , event.event_no=4 , team_with.participant1=9 or team_with.participant2=9 or team_with.participant3=9; i have written particular query, , obtained required id's in row. not able modify query such that, in place of these id's, names connected id's displayed. the student_detatil table consists of pk(sam_id) , attribute name . ids displayed present query fks connected student_detail.sam_id. . it seems bad design multiply columns storing different participants. consider creating separate row each participant , storing them in table. joining logic easier. also, please use explicit join syntax - makes query clearer , easier understand separating join logic conditions data retrieval. remember operator and has precedence on or , event.event_no = 4 not apply each participant condition. believe mistake, 1 judge. as...

Not able to convert RAW Image File(*.ARW) to jpg in java -

i tried using jrawio , other lib couldn't convert arw raw image file jpg. can ? below code tried test : bufferedimage image= imageio.read(new file("d:/sony_a500_05.arw")); imageio.write(image, "jpg", new file("d:/a.jpg")); got exception : exception in thread "main" java.util.nosuchelementexception: no tags key = srf2 key @ it.tidalwave.imageio.raw.directory.getinteger(directory.java:587) @ it.tidalwave.imageio.srf.sonysrfmakernotesupport.getsrf2key(sonysrfmakernotesupport.java:34) @ it.tidalwave.imageio.srf.sonymakernote.loadall(sonymakernote.java:120) @ it.tidalwave.imageio.tiff.tiffimagereadersupport.processmakernote(tiffimagereadersupport.java:447) @ it.tidalwave.imageio.tiff.tiffimagereadersupport.processexifandmakernote(tiffimagereadersupport.java:404) @ it.tidalwave.imageio.tiff.tiffimagereadersupport.processmetadata(tiffimagereadersupport.java:380) @ it.tidalwave.imageio.raw.rawimagereade...

r - Grouping words that are similar -

Image
companyname <- c('kraft', 'kraft foods', 'kfraft', 'nestle', 'nestle usa', 'gm', 'general motors', 'the dow chemical company', 'dow') i want either: companyname2 kraft kraft kraft nestle nestle general motors general motors dow dow but absolutely fine with: companyname2 1 1 1 2 2 3 3 i see algorithms getting distance between 2 words, if had 1 weird name compare other names , pick 1 lowest distance. have thousands of names , want group them groups. i not know elastic search, 1 of functions in elastic package or other function me out here? i'm sorry there's no programming here. know. way out of area of normal expertise. solution: use string distance you're on right track. here r code started: install.packages("stringdist") # install package library("stringdist") companyname <- c('kraft', 'kraft foods', 'kfraft', 'nestle...

mysqli - how to rectify this "SQL syntax" in php&mysql -

i'm trying create tagging sys demo here. , i'm stumped why error you have error in sql syntax; check manual corresponds mariadb server version right syntax use near '#ok )' @ line 1 here code: $insert=mysqli_query($conn, 'insert `hashtag` (posts) values ('.$data1.')') or die(mysqli_error($conn)); any appreciated. in mysqli query don't have put $conn . remove , in query put '".$data1."' , check.

python - How to remove a cell of certain value from a CSV file -

i've csv file has got single cell @ last row. need find delete. e.g. total1254612 the value of total won't same time causing problem. you can leverage fact know there 1 value , first 5 letters 'total' . rewrite lines don't meet these conditions new file: f_original = open(fname, 'r') f_new = open(fname+'_new.csv', 'w') #iterate through lines line in f_original: if line.startswith('total'): f_new.write(line) f_original.close() f_new.close()

php - How to show two views of one controller in the same page CAKEPHP -

i have doubt few days ago. hope explain well, , sorry english. im working cakephp, well, have controllers own views, etc.. happens is: have 2 functions in controller, , want that, when mouse click on 1 element (in case, google chart pie chart) of view "one", want execute other function of controller (that renders view "two") view one, but, in same page. i know how treat click on pie chart, isnt problem. problem is, how keep visible view 1 when treat click on , go other view two. mean, want have in end, page default 2 views, 1 , two, each has own function in controller, isnt simple view, text, table... i have tried solutions: requestaction, href of javascript, helpers... dont solution. i'd grateful if me! question ask me, , hope have explained , understand english! greetings! the way can making element 1 of views , add element in other view. can add element in view $his->element('elementname'); . see http://book.cakephp.org/1.3/e...

jquery - Firefox and IE not downloading MP4 file from different origin -

i've case in chrome working fine firefox , ie not. case: need download mp4 file different origin using button anchor tag. below code it: <a id="lnkdownloadvid" class="btn-download" href="www.downloadlink.com/downloadvideo.mp4" download="testdownload.mp4"> <span>download atv</span> <span> <img src="../app_themes/default/images/example/download-icon.png" style="width: 15px;" /> </span> </a> my domain www.example.com , i'm trying download www.downloadlink.com video file named "downloadvideo.mp4". issue i'm facing in firefox , ie instead of downloading starts streaming video, need download video instead of streaming. can have solution either using jquery or html5 ? don't want use server side because video file size huge (approx 100+ mb).