Posts

Showing posts from January, 2010

What does |= do in Javascript? -

this question has answer here: what “|=” mean? (pipe equal operator) 6 answers while trying fix bug in person's code, found line: affiliationdata.affiliationstatuses |= affiliationstatuses.affiliatedwithcurrentcrmuser; what do? tried find on mdn, searching |= returns 0 results . bitwise or assignment shorthand operator: x |= y meaning: x = x | y source

Can any one tell me the css selector for this expression: -

xpath = a[contains(text(),'dbfsbdj')] i have tried a:contains('dbfsbdj') - invalid ? you can't select element text content css. if want use javascript, ( jsfiddle ): var paragraphs = document.getelementsbytagname('p'); [].slice.call(paragraphs).foreach(function(p) { if(p.textcontent.indexof('world') > -1) { console.log(p); } }); // => <p>world</p> html: <p>hello</p> <p>world</p> you make little function this: var paragraphs = document.getelementsbytagname('p'); console.log(contains(paragraphs, 'world')); // => [<p>world</p>] function contains(_elements, text) { var elements = []; [].slice.call(_elements).foreach(function(p) { if(p.textcontent.indexof('world') > -1) { elements.push(p); } }); return elements; }

emacs - Where is the convention to mark a symbol with `<symbol>' in comments comes from? -

i see both in man page , in emacs lisp doc string, looks convention; there formal document that? what contexts should follow rule? @lawlist has answered wrt can find doc this. the reason convention allows code composes buffer recognize things are: variables, functions, macros, keys, etc., , put links on them take other buffers. without convention more problematic trying determine whether foo refers variable foo , function foo etc.

ios - New added UITabelView cell is hidden when keyboard is showing in xcode -

currently designed add new line cell in uitableview when user press return button of keyboard. problem after 4 or 5 uitableview cell added, new cell hidden under keyboard. i'm trying solve adjust uitableview when return key pressed failed. following code. - (bool)textview:(uitextview *)textview shouldchangetextinrange:(nsrange)range replacementtext:(nsstring *)text{ if ([text isequaltostring:@"\n"]) { coachpaditem *newcoachpaditem = [[coachpaditem alloc]init]; newcoachpaditem.coachpaddescription = @"null"; newcoachpaditem.coachpadtagid = @"0"; [_tagpointsarray addobject:newcoachpaditem]; nsindexpath *indexpath = [nsindexpath indexpathforrow:[_tagpointsarray count]-1 insection:0]; [_coachpadtableview beginupdates]; coachpadpointcell *cell = (coachpadpointcell*)[_coachpadtableview cellforrowatindexpath:0]; [cell.txtpoint becomefirstresponder]; istype = true; if...

Android Adding watermark using FFMPEG after reading from resources -

i need little adding watermark after reading app reasources.. have done , worked quite awesome when read directly specific folder. want make idea generic , want read resources apply on video. trying read watermark drawable uri watermark = uri.parse("android.resource://com.app.videoedit/"+r.drawable.watermark); my command here complexcommand =new string[] {"ffmpeg","-y" ,"-i", externalpath,"-i", outputaudiofile, "-strict","experimental", "-filter_complex", "[1:a]atempo=1.0[a1];" + "movie=" +watermark /////////////////////// here path +" [watermark];" + "[0:v][watermark] overlay=(main_w-overlay_w-10):(main_h-overlay_h-10) [outv]", "-map", "[outv]", "-map", "[a1]", "-s", "480x320","-r", "30", "-b", "15496k", "-vcodec", "mpeg4","-ab...

angularjs - angular - ngModelController $formatters won't trigger. -

hey guys i'm having trouble wrapping head around ngmodelcontroller. i have directive: app.directive('emailvalidation', function () { return { restrict: 'a', require: 'ngmodel', link: function (s, e, a, c) { c.$parsers.push(function (value) { return value.tolowercase(); }); c.$formatters.push(function (value) { if (value) { return value.touppercase(); } }); s.$watch('user.email', function () {}); } }; }); this is. $parsers work! minute type input lowercase. after goes through validation pipe. done! , can see i'm trying output upper case view still shown parser return the html looks this. <form name='email' novalidate> <input type='text' name='email' placeholder='email address' data-ng-model='user.email' required email-validation /> ...

angularjs - ui.bootstrap.datepicker is-open not working second time -

i using ui.bootstrap.datepicker , first click working , second click onwards not working. i used many options is-open='$parent.isopen' , ng-model="$parent.date =" , $timeout service nothing work me. <div class="input-group"> <input type="text" class="form-control" datetime-picker="mm/dd/yyyy hh:mm" ng-model="mydate" is-open="$parent.isopen" /> <span class="input-group-btn"> <button type="button" class="btn btn-default" ng-click="opencalendar($event, prop)"><i class="fa fa-calendar"></i></button> </span> </div> this solution works, problem $scope. html <input ng-click="opendatepicker($event)" type="text" class="form-control" datepicker-popup="mm-dd-yyyy" ng-model="submission.require_date" is-open="mydp...

Place least significant bits of int into char in C++ -

i find maximally efficient way compute char contains least significant bits of int in c++11. solution must work possible standards-compliant compiler. (i'm using n3290 c++ draft spec, c++11.) the reason i'm writing fuzz tester, , want check libraries require std::string input. need generate random characters strings. pseudo-random generator i'm using provides ints low bits pretty uniformly random, i'm not sure of exact range. (basically exact range depends on "size of test case" runtime parameter.) if didn't care working on compiler, simple as: inline char int2char(int i) { return i; } before dismiss trivial question, consider that: you don't know whether char signed or unsigned type. if char signed, conversion unrepresentable int char "implementation-defined" (§4.7/3). far better undefined , solution i'd need see evidence standard prohibits things converting ints not between char_min , char_max '\0'...

android - Record opengl fbo made with c++ with java MediaCodec -

i'm trying record contents of fbo create , fill in c++ mediacodec java object. i understand need surface mediacodec , draw on frag shader, i'm trying feed c++ fbo uniform shader. at moment can write video , if draw pixels red shader got red clip, ok on shader=>surface=>mediacodec side. to use fbo i'm passing glunit of texture of fbo java side jni function, , seems ok, got noise, not initializated texture. so question is: in way possible use texture done c++ input uniform gles2 java shader? and if yes, correct flow so? to clarify, i'm doing in glsurfaceview.renderer class: @override public void onsurfacecreated(gl10 gl, eglconfig config) { log.i("of","onsurfacecreated"); ofandroid.onsurfacecreated(); try{ ((ofactivity)ofandroid.getcontext()).onglsurfacecreated(); }catch(exception e){ log.e("of","couldn call onglsurfacecreated",e); } return; } @override public void o...

android - Samsung Galaxy Nexus S3 issues rendering View Objects (multiple issues) -

device: samsung galaxy nexus install: device blank, used development android version: 4.2.2 so started working project today. noticed when typed edittext object using default on screen keyboard not hint set not going away there white vertical lines on either side of each character typed. i messed around properties (though barely did minimum add edittext via xml). after while send apk co-worker , asked him run on device (not galaxy nexus). screen cap sent me showed no such errors. decided ignore , move on. the rest of day has been odd issues shouldn't happening. 1 example had activity fragment , after task attempted switch out fragments. (they added programmatically framelayout viewgroup in activities layout (after other methods failed)). new fragment added old still show. pressing home/recent , returning app removed fragment shouldn't have been showing @ all. decided change layout file using setcontentview of activity instead of switching activities. same resul...

opencl - Meaning of CL_UNORM_INT8 for cl_image_format.image_channel_data_type, and its diffrence with other data types -

everyone! i'm not clear meaning of cl_unorm_int8, 1 of available choice of value of cl_image_format.image_channel_data_type; what's specific type, , what's difference cl_unsigned_int8? as far storage concerned, these types identical. in both cases, each pixel channel value stored 8-bit integer, values in range 0-255. difference comes when reading/writing image kernel. for cl_unsigned_int8 type, use read_imageui , write_imageui functions access image. these functions return (or accept) unsigned integer, values in same range storage type. for cl_unorm_int8 type, use read_imagef , write_imagef functions access image. these functions return (or accept) normalised floating point value, in range 0.0f - 1.0f . devices (e.g. gpus) have hardware support normalising texture values, conversion between integer , normalised floating point values efficient.

oracle - Hierarchical generated tree code on insert -

http://i.stack.imgur.com/wex9w.jpg on every insert in table, want generate code (1, 1.1, 1.2 ...) based on code parent of object inserting. my approach this: - make sql function generate code somehow, , called via trigger on every insert in table. had hard time string parsing, think best solution? thanks. you find parent object, let's it's code 1.3 , count siblings rows same parent, let's found 2 brothers. new code value 1.3.3. method demands selecting same table on trigger works. , may cause "ora-04091: table name mutating, trigger/function may not see it" when insert several rows @ time. there workarounds avoid this. another way use view based on query, instead of trigger: select id, pid, ltrim(sys_connect_by_path(rn, '.'),'.') code ( select id, pid, row_number() on (partition level, pid order seq) rn data connect pid = prior id start pid null ) connect pid = prior id start pid null s...

date - How to get DateSeparator in C -

i wish date separator accordingly system's format's settings. in delphi i'm using system.sysutils.tformatsettings.dateseparator, there in c? the c language , standard library not provide such information. information can obtained whatever system targeting. how dependent on system target.

joomla - Jquery to change href -

i have used javascript change href when browser width goes below 767px. using same code on different site link side pop out not work above 767px redirect correct page below 767px. please can me make changes anchor open side pop out works above 767px. site: http://signfit.multi-web-services.co.uk/ jquery: jquery(document).ready(function() { jquery('.pwebcontact229_toggler').off().click(function (e) { e.preventdefault(); if (jquery(window).width() < 767) { window.location = '/contact-us'; } else { pwebcontact229.toggleform(); } }); }); the problem event being fired , changing document ready window load seems have fixed issue. don't know if correct way javascript novice; seems have worked me though!

AngularJs Display a popover on click of progressbar -

i looking display popover on click of progress bar , can accomplished without loading boostrap (additional js files?) looking add simple title , description popover on click. learning angularjs , trying create dummy project you need use native js onclick event , needs html&css loaded in index page. cant use angular ng-click , other directive before bootstrap.

elixir - Phoenix equivalent of Rails' params[:controller] -

i'm trying find phoenix equivalent of rails' params[:controller] , can serve stylesheets , javascript files based on controller rendering view. in rails, this: <%= stylesheet_link_tag 'application', params[:controller] %> <%= javascript_include_tag 'application', params[:controller] %> source: rails asset pipeline - controller specific assets i'm trying same thing in phoenix. i'm separating sass files according controllers. maybe this? <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>"> <link rel="stylesheet" href="<%= static_path(@conn, "/css/#{@controller}.css") %>"> you can build class phoenix.controller.controller_module/1 https://github.com/phoenixframework/phoenix/blob/3fc98f8b18095b6d155f5afd824f7c5e24447187/lib/phoenix/controller.ex#l112-l116

jsf - Primefaces selectOneMenu not displaying initial value -

i set selectonemenu pojos , converter, in p:dialog , see sources below. does work, except initially, when first displayed in not-dropped-down state, first choice selected, not 1 corresponding bean value. if save state of selectonemenu without interacting @ all, selected first choice saved , real value overwritten, if select differenct choice, saved properly. bean value selectonemenu bound can't null . i debugged converter, , turned out, when backing data loaded , dialog refreshed , displayed, of choices go through converter's getasstring() , plus choice real bean value again . still, first choice gets selected , displayed in selectonemenu. when dialog's form commited, selected choice goes through converter's getasobject() , regardless whether wrongly selected initial value or manually selected one. please advise might problem. the xhtml of button invokes dialog, in different form: <p:commandbutton id="toolbareditbutton" value=...

Print two arrays side by side in a multidimensional array Javascript -

this code: function chunk(arr, size) { answer = [['']['']]; firsthalf = arr.slice(0,size); secondhalf = arr.slice(size, arr.length); return firsthalf; } chunk(['a', 'b', 'c', 'd'], 2); my goal print 2 cut arrays side side. i'm looking result this: [[ 'a', 'b' ],[ 'c', 'd' ]] i know need push 2 seperate arrays somehow, can't seem work. here 1 way create data structure you're looking for. modified function returns array 2 split arrays in it. function chunk(arr, size) { var firsthalf = arr.slice(0,size); var secondhalf = arr.slice(size, arr.length); return [firsthalf, secondhalf]; } var out = chunk(['a', 'b', 'c', 'd'], 2); console.log(out);

php - unable to display data from Javascript sourced data in datatable -

i have been trying display javascript sourced data in datatable. not work. tried link . did is: js: var dataset = [ ['trident','internet explorer 4.0','win 95+','4','x'], ['trident','internet explorer 5.0','win 95+','5','c'], ['trident','internet explorer 5.5','win 95+','5.5','a'], ['trident','internet explorer 6','win 98+','6','a'], ['trident','internet explorer 7','win xp sp2+','7','a'], ] $(document).ready(function() { $('#demo').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="example"></table>' ); $('#example').datatable( { "data": dataset, "columns": [ { "title": "engine...

vb.net - Circular images -

in application, users allowed choose picture want , picture shows in picturebox. want know if there way picture select becomes circular instead of square? want images select circle shaped. is there anyway this? doesn't have picturebox control, can accomplish fine i tried no luck - http://www.codeproject.com/questions/430531/circle-shaped-picture-box not smartest way, worked me in similar task. if picturebox fixed size, can create "mask" hide corners. just draw image in png transparent circle in middle , make rest same color form. use image image propperty of each imagebox , set image "backgroundimage" property. way, image circle-shaped. if need imageboxes of different size, can create circle mask programmatically. edit: if prepare calculation of circle, can use "crop" images circle shape. depends on want these images later. need use them later in circle or rectangle shape?

Need specific string in SQL Server -

i need guys. i trying specific word whole string in sql server. i have following string: 'abc, xyz' need output : abc now need abc out of whole string. tried substring , trim function couldn't appropriate output. could anyonel please me? thank in advance! try use patindex example select substring ('abc, xyz',1, patindex ( '%,%', 'abc, xyz')-1)

javascript - Angularjs $http not returning Calls on ng-click after 1 st call -

i have services use in landing controller. problem when app init $http gets called default. need give params based on click. have implmented ajax call on ng-click. but getting same data on ng-click var sent = angular.module("sentanalysis",["ngroute"]); var log = console.log.bind(console); 'use strict'; sent.service('sentiments', function ($http) { var sentiments = []; return { getdata: function(api,params,callback) { log(api); var cb = callback || angular.noop; if(sentiments.length !== 0) { cb(sentiments); }else{ $http.get(api, { params : params }) .success(function(result) { sentiments = result; cb(result); }) .error(function() { cb()...

java - Sorting contents of attachments in numerical form in arraylist -

i trying non-transformed files in /attachments folder , put in array , sort non-transformed attachment array alphanumerically using java. here code // non-transformed files in /attachments folder , put in array file f = new file("d:\\template_export\\template\\attachments"); arraylist<string> attachmentfiles = new arraylist<string>(arrays.aslist(f.list())); system.out.println("attachmentfiles :" + attachmentfiles); and need sort following output: attachmentfiles :[0.gif, 1.gif, 10.gif, 11.gif, 12.gif, 13.gif, 14.gif, 15.gif, 16.gif, 17.gif, 18.gif, 19.gif, 2.gif, 20.gif, 21.gif, 22.gif, 23.gif, 24.gif, 25.gif, 26.gif, 27.gif, 28.gif, 29.gif, 3.gif, 30.html, 31.messages, 32.messages, 4.gif, 5.gif, 6.gif, 7.gif, 8.gif, 9.gif] i tried below code: collections.sort(attachmentfiles); for(string counter: attachmentfiles){ system.out.println(counter); } but it's not getting sorted. to compare 2 strings of digits of different l...

javascript - What does the filebrowser field actually do in CKEditor? -

the upload tab of image2 plugin looks - { id: 'upload', hidden: false, filebrowser: 'uploadbutton', label: lang.uploadtab, elements: [ { type: 'file', id: 'upload', label: lang.btnupload, style: 'height:40px', onchange: function(evt){ alert('file uploaded'); } }, { type: 'filebutton', id: 'uploadbutton', filebrowser: 'info:src', label: lang.btnupload, 'for': [ 'upload', 'upload' ] } ] } here in 'tab' details there filebrowser field equal 'uploadbutton' , filebrowser field in ui elemen...

How to use PHP Objects globally, and include objects from multiple file inside a function of a class? -

assume, have 2 files: dbconnect.php calculate.php calculate has abstract class "authx" functions login , signup , forgotpass , newsdisplay etc. to make functions work hav actual class "auth" above functions added in class file. db connect.php has database related functionalities, has class file now, need use objects of dbcon inside login, signup, forgotpass.etc., 1 way include settings in each of these functions again , again, works fine. but alternative , better solution think assigning , using database objects great inside functions better code flow. dbcon.php <?php class dbcon{ function connect(){ $servername = "localhost"; $username = "root"; $password = ""; $dbname="work_steelnext"; // create connection $conn = new mysqli($servername, $username, $password,$dbname); // check connection if ($conn->connect_error) { die("connect...

ios - How to set image for button in Swift/Xcode -

i receiving "nil" error when trying set image button programmatically. doing wrong? these not optionals. @iboutlet weak var scrollview: uiscrollview! var imagebutton: uibutton! var index: int = 0 var images: [uiimage] = [uiimage(named: "image1.png")!, uiimage(named: "image2.png")!, uiimage(named: "image3.png")!, uiimage(named: "image4.png")!, uiimage(named: "image5.png")!, uiimage(named: "image6.png")!, uiimage(named: "image7.png")!, uiimage(named: "image8.png")!, uiimage(named: "image9.png")!, uiimage(named: "image10.png")!, uiimage(named: "image11.png")!, uiimage(named: "image12.png")!, uiimage(named: "image13.png")!, uiimage(named: "image14.png")!, uiimage(named: "image15.png")!, uiimage(named: "image16.png")!, uiimage(named: "image17.png")!, uiimage(named: "image18.png")!, uiimage(named:...

hibernate - Unable to enable filter in spring mvc interceptor -

i'm writing multenant application. i've following user entity: @entity @filterdef(name="bytenantidfilter", parameters={ @paramdef( name="tenantid", type="long") }) @filter(name = "bytenantidfilter", condition = ":tenantid = tenant_id") @table(name = "user_account") public class user { @column(name = "user_id") @id @generatedvalue(strategy = generationtype.auto) long id; @column(name = "login_id", unique = true) string loginid; for enabling filter i've written interceptor fetches session, enables relevant filter , sets parameter tenantid. following code of interceptor: public class filterenablerinterceptor implements handlerinterceptor { @autowired private entitymanagerfactory entitymanagerfactory; @override public boolean prehandle(httpservletrequest request, httpservletresponse response, object handler) ...

In Makefiles GCC C programs, What are .d files and also what is a wildcard.? -

in makefiles gcc c programs, .d files , wildcard.? rgds, these *.d files (and conventionally) make dependencies (but perhaps, , unlikely, d-language source code). the gcc compiler knows -m (and related) preprocessor option , asks make .... instead of outputting result of preprocessing, output rule suitable make describing dependencies of main source file. with of few makefile tricks, write makefile automatically dealing dependencies, e.g. things like ## dependencies of foo.c foo.d: foo.c $(compile.c) -m $^ -o $@ ## include them -include foo.d about $(wildcard *.c) , read gnu make documentation , section on file name functions . $(wildcard *.c) globbing *.c make expanding list of files ending .c ; use e.g. define make variable: source_files= $(wildcard *.c) , etc. see this , that , that examples. don't forget try make -p understand builtin rules known gnu make .... use make --trace or remake -x debugging makefile -s. ...

How to populate listview from two sqlite table rows in listview in Android? -

i have retrieve json string , update,insert , retrieve record 1 one 2 different sqlite table.but how show retrieved data 2 different table in list view concatenating , add 1 one in list-view.can suggest me how this? here code private class getallactivity extends asynctask<void, void, void> { @override protected void onpreexecute() { super.onpreexecute(); // showing progress dialog pdialog = new progressdialog(allposts_page.this); pdialog.setprogressstyle(progressdialog.style_spinner); pdialog.setmessage("please wait..."); pdialog.setindeterminate(false); pdialog.setcancelable(false); pdialog.show(); } @override protected void doinbackground(void... arg0) { getallactivitylist(); return null; } @override ...

python 3.x - binary input with an ASCII text header, read from stdin -

i want read binary pnm image file stdin. file contains header encoded ascii text, , payload binary. simplified example of reading header, have created following snippet: #! /usr/bin/env python3 import sys header = sys.stdin.readline() print("header=["+header.strip()+"]") i run "test.py" (from bash shell), , works fine in case: $ printf "p5 1 1 255\n\x41" |./test.py header=[p5 1 1 255] however, small change in binary payload breaks it: $ printf "p5 1 1 255\n\x81" |./test.py traceback (most recent call last): file "./test.py", line 3, in <module> header = sys.stdin.readline() file "/usr/lib/python3.4/codecs.py", line 313, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) unicodedecodeerror: 'utf-8' codec can't decode byte 0x81 in position 11: invalid start byte is there easy way make work in python 3? to read binary data, should use ...

asp.net mvc - How to set up an IIS Rewrite rule for everything except the /api route -

i'm setting webapi application angular front-end. want enable html5mode, web server needs have re-write rule sends requests index page. the problem actions in /api route matching rule of course, none of rest calls pass through rewrite rule. i'm sure i'm not alone problem. can share section of web.config rest service works , html5mode isn't broken? <system.webserver> <modules> <remove name="formsauthentication" /> </modules> <handlers> <remove name="extensionlessurlhandler-integrated-4.0" /> <remove name="optionsverbhandler" /> <remove name="traceverbhandler" /> <add name="extensionlessurlhandler-integrated-4.0" path="*." verb="*" type="system.web.handlers.transferrequesthandler" precondition="integratedmode,runtimeversionv4.0" /> </handlers> <rewrite...

How to send a JSON object(in get method) over Request with Android? -

i want send following parameter data={"method": "category", "parameter": {"id":20, "language":"en"}} to web service how can android method? tried did not work. your json created : try { jsonobject jsonobject = new jsonobject(); jsonobject.put("method", "category"); jsonobject jsonobject1 = new jsonobject(); jsonobject1.put("id", 20); jsonobject1.put("language", "en"); jsonobject.put("parameter",jsonobject1 ); } catch (jsonexception e) { e.printstacktrace(); } now can add in request key "data"

asp.net - Which date and time will insert into SQL Server Database if I wrote in sql query as Getdate() for createDate field? -

if published asp.net solution on server , server date time correct. now, when user access url lan network on pc , pc date time not correct. in case if write insert tblcomp(1,'xyz','jam',getdate()) in query.then date time inserted.server or pc(which have accessing url) tblcomp structure ******************** id int, sname varchar(50), sadd varchar(50), createdate datetime ********************* the query executes on database server, database server provide current date , time. please note date , time in whatever time zone database server in well. from the documentation of getdate() : returns current database system timestamp datetime value without database time zone offset. value derived operating system of computer on instance of sql server running. if, on other hand, want local date , time of client, have provide through parameter. on asp.net site, not easy because "client code" asp.net application, running on web server, instea...

c# - Calling a Dynamic String from one class to another -

i new c# , tried call string variable 1 class another. it works fine. string called 1 assigned public @ top. in runtime string changes , can't string variable dynamic. please me in getting dynamic string value 1 class another. right, presuming have 2 classes. class class1 { public string string1; //code class1 } class class2 { class1 c1 = new class1(); string string1 = c1.string1; } the first class contains public string, , second class contains access public string. however, when add method second class calls string, call string when class initialised. to make method call latest version of string use this: class class1 { public string string1; //code class1 } class class2 { class1 c1 = new class1(); public void method1 { var string1 = c1.string1; } } i believe fix issue, comment if doesn't help. references: experience, mdsn

watchkit - Could the screen of apple watch be scrolling/paging style? -

if want design things on apple watch many contents exceeds screen, scroll or paged? yes. does. wkinterface allows scroll bottom/up when content more screen size. keep on adding content interface, watchkit automatically create scroll allows view content bottom. second 1 horizontal scrolling page page. in watchkit there 1 way horizontal page based scrolling. have set page based ui. have have new instance of controller each page. see link more info.

jquery - Asp.net MVC deserialize Kendo Grid data in the controller -

i have asp.net mvc 4 application. have view kendo.grid , want send ajax (json.stringify) data of grid @ controller. my problem controller receives list of string , don't know how deserialize json data. code this object contained in rows of grid: public class coursedto { public string codcourse { get; set; } public string descourse { get; set; } } this definition of grid in view: @(html.kendo().grid<coursedto>() .name("gridcourses") .columns(columns => { columns.bound(c => c.codcourse); columns.bound(c => c.descourse); }) .datasource(datasource => datasource .ajax() .serveroperation(false) .read("getallcourses", "controllercourses") ) ) this ajax call controller jquery: function passthegrid() { $.ajax({ url: "@url.action("showcourses")", type: "post", data: { courses : json.st...

java - JavaFX create and use custom control with it's own functions -

Image
i have created simple custom control shown in picture: when click on "click me" button console shows me message "the button clicked!" function called dosomething , , custom control's fxml file code: <?xml version="1.0" encoding="utf-8"?> <?import javafx.scene.control.*?> <?import java.lang.*?> <?import javafx.scene.layout.*?> <?import javafx.scene.layout.anchorpane?> <fx:root prefheight="83.0" prefwidth="196.0" type="javafx.scene.layout.anchorpane" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> <children> <textfield fx:id="textfield" layouty="2.0" prefheight="25.0" prefwidth="196.0" /> <button layoutx="72.0" layouty="29.0" mnemonicparsing="false" onaction="#dosomething" text="click me" /> </childr...

linux - how to load and boot yocto image on the arm hardware? -

i have generated custom linux image yocto hob, , output in /tmp/deploy/images/qumearm folder below: xxx.rootfs.ext4 size:51mb xxx.rootfs.tar.bz2 size:13.2mb xxx.rootfs.manifest (the compiled packages list file) in folder have other files like:zimage,image-qumearm.bin.but don't sure if zimage,image-qumearm.bin output file generated time. can tell me ,how load , boot image on arm board? lot! on hardware i'm using zimage flashed on sd card u-boot spl (preloader), u-boot , rootfs. depends on configuration. typical boot scheme is: u-boot spl ->u-boot ->linux_image. linux_image can zimage or uimage.

xaml - Create a page indicator in wp8 -

Image
hi trying implement slider shown in figure below. easy in web using jquery. problem have implement in wp8. idea how make circular rings marked , on swipe right ring should marked. code snippet if have great. you may try way. sample. mainpage.xaml <grid> <hub name="hub" sectionsinviewchanged="hub_sectionsinviewchanged" > <hubsection tag="0" background="red" /> <hubsection tag="1" background="blue" /> <hubsection tag="2" background="green" /> <hubsection tag="3" background="aqua" /> </hub> <grid width="80" height="30" verticalalignment="bottom" margin="20,20,20,20"> <grid.columndefinitions> <columndefinition width="20" /> <columndefinition width="20" /> ...

firebase - How do I prevent updates to nonexistent nodes? -

i using rest api patch nodes in firebase store. prevent updates nodes not exist (because deleted). right now, doing patch nonexistent reference recreates it. i looked setting security rules, newdata.exists() not discriminate between setting new value , patching, couldn't figure out how allow want without restricting new creations. i can snapshot of reference , check before patching, hoping there more elegant way without using 2 rest calls. edit: code! my firebase schema looks like: requests: rq123: id: '123' sender: '1' recipient: '2' expiration: '1234567', filled: false, filleddate: '', new requests written mobile client. server can make updates request entries using rest api. using python-firebase library, looks like: request_ref = firebase_root + '/requests/' + request.id patch_data = { 'filled':'true', 'filled_date...

javascript - Accessing the isolate scope of a compiled directive -

i compiling directive using following code: var element, $injector, $compile, link, scope; element = angular.element(document.getelementbyid(#whatever)); $injector = element.injector(); $compile = $injector.get('$compile'); link = $compile(angular.element('<my-directive></my-directive>')); scope = element.scope(); scope.foo = 'foo'; // want place on isolate scope! element.append(link(scope)); the directive has isolate scope. scope variable above gives me scope parent element. how can isolate scope directive? angular element object has predefined functions such isolatedscope . challenge call on right element. works: angular.element(link(scope)).isolatescope() here hold of compiled+linked html fragment directive , call isolatedscope() function isolated scope.

javascript - How to take the value of a clicked event on another page or div in PHP? -

i want echo value of clicked event in div , don't know logic should use in function changecolor() . <fieldset class="step"> <legend>roti</legend> <?php $qu = mysql_query("select * submenu menu_id=33") or die(mysql_error()); while($f = mysql_fetch_array($qu)){ ?> <p> <label for="name" onclick="changecolor(this)"><?php echo $f['submenu']; ?></label> <script> function changecolor(obj){ obj.style.color = "red"; } </script> </p> <?php } ?> </fieldset> you can use javascript's innerhtml method this. <p> <label for="name" onclick="changecolor...

sql - orientDB - graph - updated nodes based on index lookup -

i have graph structure root node, several container nodes (i'll call them lvl1) each containing hundreds of thousands of content nodes (lvl2). content nodes may linked arbitrary numbers of other content nodes. lvl1 nodes never link each other , link lvl2 nodes once. when graph gets constructed, links between lvl2 nodes may appear multiple times, in case need keep count of links (increment depth property on appropriate edge). order of construction quite random. i'm looking efficient way manage graph structure orientdb. building eays, problem updating lvl2 nodes (adding more links) , links between them. one way select standard sql-query, select lvl2nodes id = 114 - query whole dataset , slow, far can see (i didn't test yet). so idea use index lookups. created automatic indexing create index lvl2node.id unique , tried query that: select index:lvl2node.id key = 114 , gives me tuple ({:key 114, :rid #<odocument lvl2node#8:1{id:114,in:[2],out:[1]} v1>}) . now...

c++ - Uninitialised value in cmp function qsort -

i'm trying understand what's wrong code: int mycompare( const void * v1, const void * v2 ){ const int * f1 = static_cast<const int *>(v1); const int * f2 = static_cast<const int *>(v2); if( f1[ 0 ] < f2[ 0 ] ) return -1; if( f1[ 0 ] > f2[ 0 ] ) return +1; return 0; } this comparator function qsort work's fine when i've profiled valgrind have message in strings conditional jump or move depends on uninitialised value(s) if( f1[ 0 ] < f2[ 0 ] ) return -1; if( f1[ 0 ] > f2[ 0 ] ) return +1; qsort calling here valgrind output ==25053== conditional jump or move depends on uninitialised value(s) ==25053== @ 0x66474cb: msort_with_tmp.part.0 (msort.c:83) ==25053== 0x6647221: msort_with_tmp.part.0 (msort.c:45) ==25053== 0x6647221: msort_with_tmp.part.0 (msort.c:45) ==25053== 0x664777b: qsort_r (msort.c:45) ==25053== 0x40d002: owopenclsolver::_runsort(owconfigprorerty*)(owopenclsolver.cpp:473) ==25053== 0...

java - Unable to use UX Studio with java7 - upgrade to java8 not neccessary -

after latest demandware update couldn't work ux studio anymore. have found java8 required. since don't want install java8, way make work java 7? i want share 1 way overcome problem if can't install java 8 on machine. since occurs because ssl certificate switched tls1.1 still use java 7, 1 file should copied java 8. replace default trusted keystore file - cacerts, 1 java 8. how can done: locate file named "cacerts" inside java 7 lib directory, rename ( backup ), find file same name used java 8, copy file found in java 8 java 7 this method doesn't mean need install java 8. need find file cacerts can copied machine has installed, or can unpack downloaded archive. fastest way solve issue. have tested , works.

php - Send a mail to multiple receipients in codeigniter -

in controller there code sending email 1 receipient,but want send mail multiple receipients.not use cc,bcc or direct assignment.i want enter comma seperated mail ids through frond end how take each mail id in comma seperated form? controller: public function shopshare($userid,$shopname,$shop_id) { $from_email=$this->input->post('from_email'); $to_email=$this->input->post('to_email'); $subject_url=$this->input->post('url'); $message=$this->input->post('message'); $this->email->from($from_email); $this->email->to($to_email); $this->email->subject($url); $this->email->message($message); $this->email->send(); redirect(base_url().'shop/shopdetail/'.$shop_id.'/'.$shopname); } view: <label> <span>to:</span> <input id="to_email" type="text" name="to_email[]" placeholder=...

email - Extract attachements using mailbox python? -

i wanted extract email attachments mbox using mailbox library in python. i've used following code extract from, to, subject, date, body import mailbox mbox = mailbox.mbox('/tmp/personal folders/inbox/mbox') message in mbox: print message['subject'] print message['to'] print message['from'] print message['date'] how find , extract attachments in every mails? need include more library ? use get_payload() method ( https://docs.python.org/2/library/email.message.html#email.message.message.get_payload ). return current payload, list of message objects when is_multipart() true, or string when is_multipart() false. ex: print message.get_payload()

visual studio 2015 - TFS won't compile string interpolation syntax -

i updated visual studio 2015 when released last week. resharper suggested might update following string using string.format : string filepath = httpcontext.server.mappath(string.format("~/app_data/{0}.xlsx", guid.newguid())); to use string interpolation: string filepath = httpcontext.server.mappath($"~/app_data/{guid.newguid()}.xlsx"); i did this, , well. however i've broken build on tfs: controllers\mycontroller.cs (224): unexpected character '$' so seems new features in c# 6 can't compiled our older, non-updated version of tfs. the project still targeted @ using framework 4.5 however, have not targeted 4.6. (wrongly) assumed still targeting old framework mean built other team members still using vs2013 along our tfs build server. so looks our tfs needs update of... something. what need install on tfs server have compile new syntax? latest version of .net framework or else? install .net framework 4.6 , build ...

php - Search query with table display -

i have page table.php here' has search displays database table in table format. code below can search , can display data not in table format. please me code make display search in table format. $output=''; $noresult=''; //collect if (isset($_post['search'])) { $searchq = $_post['search']; $searchq = preg_replace("#[^0-9a-z]#i","",$searchq); $query = mysql_query("select * transaction patientid '%$searchq%' ") or die ("could not search"); $count = mysql_num_rows($query); if($count == 0) { $noresult = 'there no search results!'; } else { while($row = mysql_fetch_array($query)) { $tranid = $row['tranid']; $trandate = $row['trandate']; ...