Posts

Showing posts from January, 2015

webdriver - selenium is trowing an error as element is not visble -

i have java script injection send text hidden inputbox. webdriver throwing error element not visible cannot interacted with. webelement tmpelement= driver.findelement(by.classname("cwd_input")); javascriptexecutor executor = (javascriptexecutor)driver; executor.executescript(("document.getelementsbyclassname('cwd_input') [0].click();"),tmpelement); tmpelement.sendkeys("t"); you can set value of input via js. code like: string scripttoexecute = "document.getelementbyid("mytext").value = 'new value';"; executor.executescript(scripttoexecute);

I tried using th:remove="all-but-first" in thymeleaf but it didn't work -

<td th:remove="all-but-first"> <span th:each="groups : ${userview.user.groupmemberships}"> <span th:text="${groups.group.name}"></span>; </span> </td> i trying display first 2 rows returned in th:each , tried displaying first row @ first , didn't work. how display first row , should if want display first 2 or 3 rows in th:each ? the attribute th:remove used removing prototyping generated tags. as example: <table th:remove="all-but-first"> <tr th:each="user : ${users}"> <td th:text="${user.name}">john apricot</td> </tr> <tr> <td>martha apple</td> </tr> <tr> <td>frederic orange</td> </tr> </table> this means remove second , third tr , leaving tr used iteration. more details here . so if want display first element o

How to notify backing bean that JSF has completed rendering? -

i have boolean semaphore in managed bean denotes whether jsf page utilizes has completed rendering. default, value should false , once last bit of html has been rendered (or thereabouts), value should set true , never again, during lifecycle of bean, should go false. i suppose 1 way if have form have hidden input tied bean method sets value of semaphore true. however, there way accomplish without form? on per-view basis, use <f:view afterphase> that. <f:view afterphase="#{bean.afterphase}"> private boolean renderedonce; public void afterphase(phaseevent event) { if (event.getphaseid() == phaseid.render_response) { renderedonce = true; } }

ios - Get current webview URL and login -

i try current url because when put bad login in app, have login page displayed. don't want page displayed. so, use solution current url , if url http://www.example.com/account/login/ want create action. currently, when try solution, have null response. nsstring * currenturl = _loadscreen.request.url.absolutestring; if ([currenturl isequaltostring:@"http://www.example.com/account/login/"]) { nslog(@"warning"); } else { nslog(@"url %@",currenturl); <- return (null). } i use code auto-login users : nsstring *identifiant = [[nsuserdefaults standarduserdefaults] valueforkey:@"identifiant"]; nsstring *password = [[nsuserdefaults standarduserdefaults] valueforkey:@"password"]; if((identifiant) && (password)) { //configure url nsstring* host = @"http://www.example.com"; nsstring* complement = @"/account/login"; nsst

javascript - How to give child process control of the terminal, in Node.js? -

i have node app run terminal ( node myapp.js ). app spawns child node process (via child_process.fork ). after happens, want exit parent process, , give child process control of terminal. right now, when exit parent, child process runs in background, , terminal goes bash. how can give terminal child process, doesn't go bash? look @ child_process.spawn options.detached in node.js docs. looking for: const spawn = require('child_process').spawn; const child = spawn(process.argv[0], ['child_program.js'], { detached: true, stdio: ['ignore'] }); child.unref(); //causes parent's event loop not include child in reference count, allowing parent exit independently of child, unless there established ipc channel between child , parent. node provides child_process module has following 3 major ways create child process. exec - child_process.exec method runs command in shell/console , buffers output. spawn - child_process.spawn launches n

apache - htaccess 301 redirect rule for multiple query strings -

i want 301 redirect rule multiple query string make seo friendly url. internal url: www.example.com?p=54&p1=abc xyz&p2=xxx45767 , on. 301 redirect url: www.example.com/54-abc-xyz-xxx45767?p=54&p1=abc xyz&p2=xxx45767 so, redirect url must contain old query parameters too. first step check query_string parameters in question. if match found, redirect should occur. you can use following in /.htaccess file: rewriteengine on # check query string , capture parts rewritecond %{query_string} ^p=([^&]+)&p1=([^&]+)&p2=([^&]+)$ # if @ root of domain, redirect rewriterule ^$ /%1-%2-%3 [r=302,l] to make redirect permanent , cached browsers , search engines, change 302 301 .

sas ods - How can I create SAS html files with names corresponding to a dataset field -

i'm trying create file each record in sas dataset. have been able succesfully using sas ods output using "newfile=page" option , running proc report on dataset. problem i'm having results in gerneric, sequentially numbered file names (test, test1, test2, etc...). i'd name each file based on variable in dataset. in example below, i'd file names titled based on "seq_nbr" in dataset. ods html path = "c:\test\" file = 'test.html' contents = 'contents.html frame = 'frame.html' code = (url="c:\test\javascript.js") newfile=page; proc report data = test2 nowindows headline headskip; column tdate ttime created_by cmttext; seq_nbr; run; you need macro this %macro doit; proc sql; select count(*) :n test2 ; quit; %do i=1 %to &n; data _null_; if _n_=&i call symput('name',seq_nbr); run; proc export data=something outfile="&name"; r

regex - How to replace a float written as a string if greater or less than? -

i have image written in text format , need set pixel near black black , near white white. the file use ʜꜱʟ colour space , looks this : 0,0: (19.2529%,100%,22.7451%) #31ff3a hsl(19.2529%,100%,22.7451%) 1,0: (18.5185%,98.1818%,21.5686%) #2ffa37 hsl(18.5185%,98.1818%,21.5686%) 2,0: (18.4524%,90.3226%,24.3137%) #2fe63e hsl(18.4524%,90.3226%,24.3137%) 3,0: (18.661%,100%,22.9412%) #30ff3b hsl(18.661%,100%,22.9412%) 4,0: (18.9891%,100%,23.9216%) #30ff3d hsl(18.9891%,100%,23.9216%) 5,0: (18.9076%,100%,23.3333%) #30ff3c hsl(18.9076%,100%,23.3333%) 6,0: (18.7107%,86.8852%,23.9216%) #30de3d hsl(18.7107%,86.8852%,23.9216%) 7,0: (18.6275%,92.7273%,21.5686%) #30ec37 hsl(18.6275%,92.7273%,21.5686%) 8,0: (19.2192%,100%,21.7647%) #31ff38 hsl(19.2192%,100%,21.7647%) 9,0: (19.2529%,100%,22.7451%) #31ff3a hsl(19.2529%,100%,22.7451%) 10,0: (19.1667%,100%,23.5294%) #31ff3c hsl(19.1667%,100%,23.5294%) 11,0: (19.209%,96.7213%,23.9216%) #31f73d hsl(19.209%,96.7213%,23.9216%) 12

How to markup a floating price product in Schema.org? -

i have electronic components, , price floating. for example, if buy 5 pieces, $1 each piece. , buy 200 pieces, $0.8 each pieces. there's order range , price sheet this: 1~199 $1 200~500 $0.8 can mark in schema.org (using microdata)? you can multiple pricespecification (or in case unitpricespecification ) items. the eligiblequantity property can give quantity range in quantitativevalue item, minvalue , maxvalue properties. if want provide unitcode , can use un/cefact common code’s c62 . based on example (from comment), in microdata: <div itemscope itemtype="http://schema.org/offer"> <div itemprop="pricespecification" itemscope itemtype="http://schema.org/unitpricespecification"> <div itemprop="eligiblequantity" itemscope itemtype="http://schema.org/quantitativevalue"> <meta itemprop="unitcode" content="c62" /> <span itemprop="minvalue&

c# - How can I modify an instance of the button defined in a Cell Header? -

i have following xaml class: <listview controls:listviewcolumns.stretch="true" name="mylistitems" selectionmode="single"> <listview.view> <gridview> <gridviewcolumn width="50"> <gridviewcolumn.header> </gridviewcolumn.header> <gridviewcolumn.celltemplate> <datatemplate> <button name="btndelete" horizontalcontentalignment="center" verticalcontentalignment="center" padding="0" margin="0" isenabled="{binding converter={staticresource inverseboolconverter},

installshield - How can I access a (disk1 support) subdirectory? -

i'm trying design install package web based application. requires custom instance of sql server needs user defined. have .ini file that's used while executing sql installation. i have copied sql installation folder disk1 section of support files of installshield ide , can't seem access files within folder in order dynamically modify .ini trigger custom sql installation. how correctly reference subdirectory of disk1 support files? following research on have tried numerous variations such launchappandwait(srcdir ^ "\sqlserver\install.bat", "", wait) yet have not had luck. for interested solution question after trial , error (launchappandwait(package_location ^ "sqlserver/install.bat", "", wait) < 0)

c++ - Entering command as a parameter to another application -

i using virtuoso engine . entering query virtuoso engine, following needs done: the virtuoso engine starts , gives command prompt: [mymachine]$ ./isql 1111 connected openlink virtuoso driver: 07.20.3213 openlink virtuoso odbc driver openlink interactive sql (virtuoso), version 0.9849b. type help; , exit; exit. sql> the query "sparql select ?a?b?c where{graph ?g{?a ?b ?c} };" entered user following: [mymachine]$ ./isql 1111 connected openlink virtuoso driver: 07.20.3213 openlink virtuoso odbc driver openlink interactive sql (virtuoso), version 0.9849b. type help; , exit; exit. sql> sparql select ?a?b?c where{graph ?g{?a ?b ?c} }; now in order automate process of inserting queries virtuoso wrote user entered value: "sparql select ?a?b?c where{graph ?g{?a ?b ?c} };" text file ( mytext.txt ) , used following command: [mymachine]$ ./isql 1111 < mytext.txt however still virtuoso prompt appears following -- asking me enter query string: [m

sql - Remove row from results under when statement -

when q.programtitle in ('therapeutic massage aos','therapeutic massage','therapeutic massage oad','therapeutic massage (h)','therapeutic massage oad') , max(m.opeid) in ('031151-02') '11' when q.programtitle in ('x-ray medical technician','x-ray medical technician aos','x-ray medical technician*') , max(m.opeid) in ('031151-02') '14' when q.programtitle = 'surgical technology' , max(m.opeid) in ('031151-00') '15' when q.programtitle = 'emergency medical technician' end 'length of ge program', okay, need remove rows contain program name 'emergency medical technician' under when statement, have no idea how code that. suggestions?

javascript - Calculating the point where two circles touch based on circle1's velocity -

Image
we have 2 circles, circle1 & circle2, circle2 static , circle1 moving. circle1 = c1, circle2 = c2. c1 has velocity , direction cause touch c2 @ 1 point. v vector describing c1's velocity. d distance center point of c1 center point of c2. we know radius of both circles. frame 1: c1 has not yet collided c2, can see in next frame so. frame 2: c1 intersecting c2. frame 2 (after calculation): c1 has been positioned @ point first touched c2. so question is, how can calculate (preferably in js) point along v c1 should stop? current code: // x^2 + b * x + c = 0 // x= v' // b = 2 * (d.x * v.x + d.y*v.y)/math.sqrt(v.x*v.x + v.y*v.y) // c = (d.length()^2 - rs^2) // distance ri ri2 vector. var d = new vector(ri2.x - ri.x, ri2.y - ri.y); // sum of radiuses. var rs = ri.r + ri2.r; var = 1; var b = 2 * (d.x * v.x + d.y*v.y)/math.sqrt(v.x*v.x + v.y*v.y); var c = (d.length()^2 - rs^2); var x1 = (-b + math.sqrt(math.pow(b, 2) - 4 * * c)) / 2

json - Golang slices of struct or newbie trouble building REST -

and need help. wanted build simple api , stuck problem. i've choose gin , database/sql postgres driver package main import ( "database/sql" "fmt" "github.com/gin-gonic/gin" _ "github.com/lib/pq" ) func main() { router := gin.default() router.get("/search/:text", searchword) router.run(":8080") } i need make query db , make json out of request. func checkerr(err error) { if err != nil { panic(err) } } type message struct { ticket_id int `json:"ticket_id"` event string `json:"event"` } func searchword(c *gin.context) { word := c.params.byname("text") db, err := sql.open("postgres", "host=8.8.8.8 user= password= dbname=sample") defer db.close() checkerr(err) rows, err2 := db.query("select ticket_id,event ....$1, word) checkerr(err) rows.next() { var ticket_id

python - insert node then re-balance avl tree -

i'm creating 3 functions run off of insert function avl tree class. rebalance takes node unbalanced , uses rotate left , rotate right methods depeding on nodes situation. when load avl (avl = avl()) data1 = "abcdefghijklmnopqrstuvwxyz" , print using level order print method definitly doesnt turn out how supposed be. of see going wrong? import copy list_array_1 import list class _avlnode: def __init__(self, value): """ ------------------------------------------------------- creates node containing value. use: node = _avlnode( value ) ------------------------------------------------------- preconditions: value - data node (?) postconditions: initializes avl node containing value. child pointers none, height 1. ------------------------------------------------------- """ self._value = copy.deepcopy(value) # n

c# - Object reference not set to an instance of an object Error in List -

this question has answer here: what nullreferenceexception, , how fix it? 33 answers return error "object reference not set instance of object error" when trying add item in list. in other words it's return error in addtonote.add(name); , sure name not null. protected void features(string name, string shortname) { list<string> addtonote = viewstate["note"] list<string> ; if (name.length > 0) { addtonote.add(name); } else {for (int x = 0; x < addtonote.count; x++) {if (addtonote[x].startswith(shortname)) { addtonote.removeat(x);} } } viewstate["note"] = addtonote; txtnote.text = string.join(txtnote.text , ",", addtonote); } protected void chkpersonalaccedent_checkedchanged(object sender, eventargs e) {if (chkpersonalaccedent.che

javascript - Drag and drop multiple images kineticjs -

i trying drag , drop multiple images canvas , can moved canvas. works one, when doing multiples, last 1 replaces others. this code: <!doctype html> <html> <head> <meta charset="utf-8"> <title>canvas - test</title> <style> canvas { position: relative; border: 1px solid #000; } </style> <script src="./kinetic-v4.3.2.js"></script> <!--[if lte ie 8]> <script src="../js/html5.js"></script> <![endif]--> </head> <body> <div id="container"> <header role="banner"> <h1>canvas - cure</h1> </header> <div role="main"> <section id="main-content"> <canvas id="my-canvas" width="700" height="600">i canvas</canvas> <script> (function () {

php file upload: use of unlink in a list to delete an element from the server -

i have php upload file, want add button @ right of each element of list if click on delete element list , server. possible? thanks <html> <body> <form action="" method="post" enctype="multipart/form-data"> select file upload: <input type="file" name="filetoupload" id="filetoupload"> <input type="submit" value="load" name="submit"> </form> <div> <?php $dir = 'up/'; $files = scandir($dir); echo 'uploaded files<br><hr>'; $i = 1; foreach ($files $key) { if ($i>2) { $j = $i-2; echo $j."&nbsp&nbsp<a href='up/".$key."'>".$key."</a><hr>"; } $i++; } echo ' '; ?> </div> </body> </html> <?php if (isset($_post['submi

python - scrapy crawler caught exception reading instance data -

i new python , want use scrapy build web crawler. go through tutorial in http://blog.siliconstraits.vn/building-web-crawler-scrapy/ . spider code likes following: from scrapy.spider import basespider scrapy.selector import htmlxpathselector nettuts.items import nettutsitem scrapy.http import request class myspider(basespider): name = "nettuts" allowed_domains = ["net.tutsplus.com"] start_urls = ["http://net.tutsplus.com/"] def parse(self, response): hxs = htmlxpathselector(response) titles = hxs.select('//h1[@class="post_title"]/a/text()').extract() title in titles: item = nettutsitem() item["title"] = title yield item when launch spider command line: scrapy crawl nettus, has following error: [boto] debug: retrieving credentials metadata server. 2015-07-05 18:27:17 [boto] error: caught exception reading instance dat

How do I insert a newline in Node.js when using Heroku? -

i'm trying create node.js application on heroku output 10 different ascii faces (i have module needed that). using node tutorial on heroku, i've set output 10 faces. however, when try run code, puts of faces inline each other. how should try make faces outputted (if that's word) on own lines? my current index.js follows: var express = require('express'); var app = express(); var cool = require('cool-ascii-faces'); app.set('port', (process.env.port || 5000)); app.get('/', function(request, response) { var result = '' var times = process.env.times || 5 (i=0; < times; i++) result += cool(); response.send(result); }); app.listen(app.get('port'), function() { console.log("node app running on port: " + app.get('port')) }) i have .env file set foreman use (when testing locally) contains following: times=9 if want have @ output, head on over here . tl;dr: how use

unicode - Another Encoding/Decoding in C# Issue -

i've been working on gui cli. rather write text file, i'm redirecting standard output, , creating abject output can use/reuse within gui code. have tried every possible solution have come across, , have yet resolve issue. it's each line in return encoded in 2 different ways. here have command line interface: class cmdtoolinteraction { private static string returnstring = null; public string runcommandline(string argumentstring) { unicodeencoding uni = new unicodeencoding(); process proc; proc = new process(); proc.startinfo.filename = "cmd.exe"; proc.startinfo.arguments = argumentstring; proc.startinfo.windowstyle = processwindowstyle.hidden; proc.startinfo.useshellexecute = false; proc.startinfo.redirectstandardoutput = true; proc.startinfo.redirectstandardinput = true; proc.start(); streamwriter cmdstreamwriter = proc.standardinput; cmdst

Force Download MP3 with PHP -

be honest : found way donwload mp3 files s******d im not able donwload mp3 directly music streaming in browser. i try someting this <a href="direct_download.php?file=fineline.mp3">download mp3</a> but donwload link not .mp3, line of code donwload file href="<?php echo $val['stream_url']?>?client_id=67739332564a7130c3a05f90f2d02d2e">descargar</a>. when use the option direct_download.php?file= just donwload 1 file name client_id=05b4f2000dad27aa9fc48d08915d7830.html the complete php code use is <?php $file = $_get['file']; header ("content-type: octet/stream"); header ("content-disposition: attachment; filename=".$file.";"); header("content-length: ".filesize($file)); readfile($file); exit; ?> which can accessed in anchor this: <a href="direct_download.php?file=fineline.mp3">download mp3</a> could please me, or if have better ide

jsf - p:fileDownload to be executed at the end -

i need propertyactionlistener set correct variable prepdownloadbalanceteii method (this method creates pdf file). after that, want download pdf. what getting property being set correctly, file being downloaded before prepdownloadbalanceteii method called. <p:commandlink id="downloadbalancete" value="balancete" ajax="false" action="#{reportscontroller.prepdownloadbalanceteii}"> <f:setpropertyactionlistener value="#{object}" target="#{reportscontroller.accountingperiod}" /> <p:filedownload value="#{reportscontroller.download}" /> </p:commandlink> anyway can make work here? thank you. the action method triggered after download logic executed. use actionlistener instead of action in commandlink. actionlistener prepare file stream p:filedownload.

javascript - Reload an AJAX loaded page after update -

i'm trying understand how dynamic page loaded ajax can reloaded after 1 of records updated. i've got following jquery script on page. <script type="text/javascript"> function showuser(str) { if (str == "") { $("#txthint").empty(); return; } $("#txthint").load("data_ajax.php?q=" + str); } $(document).ready(function () { $("#txthint").delegate(".update_button", "click", function () { var id = $(this).attr("id"); var datastring = 'id='+ id ; var parent = $(this).parent(); $.ajax({ type: "post", url: "data_update_ajax.php", data: datastring }); return false; }); }); </script> i thought done code below if call within data_ajax.php page after loads corresponding data database, refreshes whole page. <script src="https:/

Rearranging values in 3 columns in SQL Server in descending order -

i want rearrange values in 3 columns ( a, b, c ) in descending order , have written logic below. logic works of times not working when "c" highest number select case when > b , > c when b > , b > c b else c end a, case when b > c , > b b when c > , c < b c else end b, case when b > c , > c c when < c , < b else b end c one way of doing be select ca.a, ca.b, ca.c t cross apply (select max(case when rn = 1 val end) a, max(case when rn = 2 val end) b, max(case when rn = 3 val end) c (select row_number() on (order val) rn, val (values (a), (b), (c)) v1(val)) v2) ca if columns null

ip - How show IPv4 only with REMOTE_ADDR in PHP? -

i have question variable : $_server['remote_addr'] . wish recovers ip addresses in ipv4 format . extracted me few times in ipv6 format . how do? $_server['remote_addr'] contains address of visitor. if contains ipv6 address visitor used ipv6 , there no ipv4 address. , vice versa of course. these days have able deal both. some visitors have ipv4, have ipv6 , have both. browser decides available , use, , that's you'll see. note browser has both might switch between ipv4 , ipv6 between requests if deems necessary connectivity.

javascript - Google Recaptcha Ajax response strange checking order -

i making registration page service. need check either google's recaptcha verified or not. decided use jquery.ajax. i have created function " checkcaptcha() " sets iscapt (if captcha valid or not) either true (fld_valid) or not (fld_empty): function checkcaptcha() { alert("1"); var captcha_response_text = grecaptcha.getresponse(); var request = $.ajax({ url: "ajax/registrationa.php", type: "post", data: { captcha: true, captcha_response: captcha_response_text } }); request.done(function (response, textstatus, jqxhr) { alert("2"); if(response) { iscapt = fld_valid; } else { iscapt = fld_empty; } }); } i have &qu

SQL and PHP brief explain -

$id=$_get['previd']; $sql = "select * pro prid=".$id; i new php. can explain happens here? this taking value of (url) passed variable "previd". http://example.com/page.php?previd=123 set previd 123. next sets variable $id 123. next $sql gets set select * pro prid=123 next nefarious person can go http://example.com/page.php?previd=;drop table pro , database has been deleted. this why people use sanitization , prepared statements. // pdo + mysql $pdo = new pdo('mysql:host=example.com;dbname=database', 'user', 'password'); $statement = $pdo->query("select some_field some_table"); $row = $statement->fetch(pdo::fetch_assoc); echo htmlentities($row['some_field']); more info

php - html_entity_decode not working for the first time -

i have string of html want decode , strip off html tag before sending them out through email. here's string : <p>this test <em>please </em><strong>ignore </strong>it &gt;&lt;&nbsp;, thank you.</p> after decode , strip off html tags using html_entity_decode , strip_tags still html entities left. strip_tags(html_entity_decode($str)); //got result test please ignore &gt;&lt;&nbsp;, thank you. only doing html_entity_decode give me correct result: html_entity_decode(strip_tags(html_entity_decode($str))); the string taken directly post variable of ckeditor. i don't understand why first html_entity_decode doesn't trick , need html_entity_decode. please explain me? thanks in advance.

php - Codeigniter - sessions not working through controller and view -

i'm trying make login using sessions in codeigniter @ time username , password match, can't it. i'm doing this: controller: public function __construct() { parent::__construct(); $this->load->model('main_select'); $this->load->helper('url'); $this->load->library('session'); } ...code when username , password match: if($pass === $user){ $this->session->set_userdata(array( 'user_id' => $login['id_user'], ));//we create session 'user_id' } here supposed created session called 'user_id' in view doesn't work, have this: if( !$this->session->userdata('id_user') ){ //see content //first content }else{ //see other //second content } but see same content('second content'). trying destroy (but not working): public function logout() {

html - web page scrolls to top when pointer passes over a submit button - but not always -

i have page on our members' web site (restricted access) has, low down on page, couple of buttons navigate elsewhere. vast majority of people these work few people have reported windows 7 (64 bit) , internet explorer 11 when trying click buttons page scrolls straight top! other combinations of os , browser seem not give behaviour , when used combination had no problems. (makes fault finding difficult!) i've searched internet (google , msn) not found relevant. i'd grateful ideas on should find solution. the page written using php no other scripting; style sheet addresses neither forms nor buttons. code 1 of buttons follows, other identical except directs different page. <form id="form1" method="post" enctype="multipart/form-data" action="http://www.hmrs.org.uk/stewards/stewardslistm.php" target="public"> <input type="hidden" id="member" name="member" value="&l

c# - I want to create a dialog box, call a class on click in unity -

i want create dialog box, used script dialog.cs. want call script, example, want click object , make appear windows dialog. unfortunatly, when click object windows dialog doens't appear. ps: since dialog script monobehaviour, added object display it. gameobject.addcomponent<dialog>(); full dialog.cs using unityengine; using system.collections.generic; public class dialog : monobehaviour { public textasset conversationasset; protected string dialogname=""; public string description=""; public bool keytriggered=true; public bool restartdialogeachtime=true; public string triggerinputkey="chat"; public string dialogclass="dialogguibasic"; public float dialogrange=3; public guiskin dialogskin; public camera dialogcamera=null; public vector2 dialogsize=new vector2(800,371); public texture2d dialogportrait=null; public float characterspersecond=50f; private conversation[]

android - How to load video thumbnails using square picasso library? -

currently i'm loading mediastore image thumbnails using picasso listview following snippet: ( video.getdata() returns actual path of image such mnt/sdcard/... ) picasso.with(this.context) .load(new file(photo.getdata())) .resize(50, 50).config(config) .centercrop() .into(viewholder.imageviewitem); now i'm , unable load mediastore video thumbnails passing video.getdata() instead of photo.getdata() ? first need create videorequesthandler public class videorequesthandler extends requesthandler{ public string scheme_video="video"; @override public boolean canhandlerequest(request data) { string scheme = data.uri.getscheme(); return (scheme_video.equals(scheme)); } @override public result load(request data, int arg1) throws ioexception { bitmap bm = thumbnailutils.createvideothumbnail(data.uri.getpath(), mediastore.images.thumbnails.mini_kind); return new

HTML contact form in PHP block -

i'm relatively new php forgive me if seems obvious. how integrate block of html code this: <form action="form.php" method="post" enctype="multipart/form-data"> <label></label> <input name="name" required="required" placeholder="your name"> <label></label> <input name="email" type="email" required="required" placeholder="your email"> <label></label> <input name="address" type="name" required="required" placeholder="your address"> <label></label> <textarea name="message" required > dear mr. x, please support us... </textarea> <input id="cancel" name="cancel" value="cancel" /> <input id="submit" name="s

java - How to use Facebook Messenger API? -

i writing java application in need access chat history (chat messages between me , facebook friend). have looked @ this link , seems outdated since have noticed facebook changed messenger api significantly. wondering if still possible access message history via java. p.s. found facebook graph api called restfb. not able find such api chat messages. you can use inbox resource of graph api: https://developers.facebook.com/docs/graph-api/reference/v2.3/user/inbox edit : in order use java, you'll need first follow login instructions @ https://developers.facebook.com/docs/facebook-login/v2.3 . that's large enough operation i'm going assume you've done -- it's outside scope of answer (but i'm sure there other questions handle sufficiently on stackoverflow if look). once have access token particular session (you can 1 test going https://developers.facebook.com/docs/graph-api/reference/v2.3/user/inbox , clicking graph explorer button, clicking &q

javascript - Partly server-side rendering -

we know server-side rendering seo, blog app. loose ux feature , not easy debug comparing client-side rendering app. i wondering if there way apply server-side rendering technique partly on parts of web app (like blog part of app), using client-side rendering rest. kinda mix server-side , client-side rendering together. not sure isomorphic app means. isomorphic javascript(aka universal javascript) can that. can make web application first rendering comes server-side, , activities after rendered client-side. please noted both sides share same code.

LC3 Multiplication -

so have lc3 coding assignment have implement , test user subroutines input , output of unsigned integers in decimal format. our input have sequence of keystrokes construct single integer value applying repeated multiplication algorithm, multiplication 10 via 4 additions. not understanding concept of multiplication 4 additions. please explain? x number want multiply 10 a = x+x = 2x b = a+a = 4x c = b+b = 8x d = a+c = 10x

html - Set background-image to a div -

i have tried code page follows: <div class="conttent-group"> <div class="conttent-group-body"> <div class="conttent-body-right"> <div class="conttent-body-left"> <h1><a href="#" style="text-decoration:none">news operations</a></h1> </div> </div> </div> </div> and although following css: * { background-color: #006; } .conttent-group { margin-top: 5px; height: 300px; width: 788px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; background: white; } .conttent-group-body { margin-left: 4px; margin-top: 5px; width: 386px; height: 30px; float: left; background: url (image / module-bg-bodynew.jpg) repeat-x top center; } .conttent-body-right { height: 30px; background: url (image / module-bg-rightnew.jp