Posts

Showing posts from June, 2015

jsf - Bootsfaces FacesMessage always displays summary and detail -

by doing this: facescontext.getcurrentinstance().addmessage(null, new facesmessage(facesmessage.severity_info,msg.getmessageresourcewithparams("admini.client.search.save.ok", new object[]{clientonsearch.getfirstname()+" "+clientonsearch.getlastname()}),null)); i expecting see summary on interface since put detail set null. but displays same messsage twice, on summary , details. client bruno laaaalapa added client bruno laaaalapa added on xhtml have: <b:row> <b:column> <b:messages/> </b:column> </b:row> is missing on ? thanks you might have found little misbehaviour there, b:messages ' detail shouldn't shown on default (default documented false , true instead, we fix 0.8.2 ). however, can explicitly hide detail specifying: <b:messages showdetail="false"/> you opt showing detail, not summary: <b:messages showdetail=&q

Python flask-paginate returning too many results on page -

im using module flask-paginate found here: http://pythonhosted.org/flask-paginate/ i able return results, , pagination begins correct number of pages, showing 69 results per page. documentation shows per_page= , affects starting page number correct. im using sql-alchemy db. @search.route('/search') def search(): page, per_page, offset, inner_window = get_page_items() links = item.query.all() total = item.query.count() pagination = get_pagination(page=page, per_page=per_page, total = total, format_total=true, format_number=true, record_name='links', ) return render_template('search/searchpage.html', offset=offset, total=total, links=links, pagination=pagination, per_page=per_page, page=page) def get_css_framework(): return 'bootstrap3' d

Docker volume mount doesn't exist -

i'm running docker 1.11 on os x , i'm trying figure out local volumes being written. created docker volume running docker volume create --name mysql . ran docker volume inspect mysql , output following: [ { "name": "mysql", "driver": "local", "mountpoint": "/mnt/sda1/var/lib/docker/volumes/mysql/_data", "labels": {} } ] the issue /mnt/sda1/var/lib/docker/volumes/mysql/_data doesn't exist on machine. thought maybe issue didn't created until used container started container running docker run --name mysql -v mysql:/var/lib/mysql -e mysql_root_password=mysql -p -d mysql:5.7 , created database in mysql, mount point still doesn't exist. ran docker inspect mysql ensure it's using correct volume , got following: ... "mounts": [ { "name": "mysql", "source": "/mnt/sda1/var/lib/docker/v

java - Generating HashSet of objects while making hibernate reverse engineering in eclipse -

Image
i have 2 tables in sql server database; equipe , ordre_de_prod table. ordre_de_prod table contains id of equipe foreign key, whenever make hibernate reverse engineering in eclipse, ordredeprod class contains object of equipe class. but, equipe class hashset of objects of ordredeprod. how cant solve problem ? thank you while generation objects, remove many-to-many , one-to-one associations per attached image.

javascript - Ruby on Rails with Showdown adding extensions error -

i have code directly from: https://github.com/coreyti/showdown i created extensions dir , added twitter.js following code: var demo = function(converter) { return [ // replace escaped @ symbols { type: 'lang', regex: '\\@', replace: 'red' } ]; } on page have: <%= javascript_include_tag "showdown" %> <%= javascript_include_tag "extensions/twitter.js" %> <script type="text/javascript"> var converter = new showdown.converter({ extensions: 'twitter' }); </script> <script type="text/javascript"> $('#design_description').keyup(function () { var converter = new showdown.converter(); var impt = converter.makehtml($(this).val()); $(".preview").html(impt); }); </script> this web console error getting: [15:04:30.945] uncaught exception: extension 'undefined' not loaded. either not found or not valid extension. any appreciat

android - how to upload apk to Google Drive via 'Manage versions" without having it converted to an archive -

i drag-and-dropped apk file google drive, got shareable link , sent competition. apk defined "android package" , good. found bug, fixed , tried upload new apk via "manage versions" have same link previous one. unlike uploading new file, uploading new version, first, doesn't imply drag-and-drop, , second, important, converts apk "compressed archive" type, breaks , new apk can't launched on android device. how forbid google manage uploading files , upload them "as is"? or how can have new apk uploaded both android package , same shareable link?

php - Why there is a class name before the argument name in a function declaration? -

i have seen in mvc frameworks. class hotel{ function add(addrequest $post){ $this->save($post->all()); } } here "addrequest" class has been inherited.i dont quiet idea of it.all knew binds/validates arguments has been passed function before being used in function.anyone can explain well? how "addrequest" being implemented in code? this type declaration (formerly known type hinting). function reject $post passed function that's not of addrequest type. if you're not explicitly injecting yourself, chances framework using reflection automatically determine , inject required dependency. example, laravel uses extensively in version 5.

Right way to make my own collection in java -

i'm trying own collection class in java. i need find data key , able iterate on , element index, decide make encapsulation of hashtable , arraylist. this code: public class geocollection <t extends geographic> implements iterable<t>, iterator<t>{ private hashtable<string,t> data_table; private arraylist<t> data; private int cursor = 0; public geocollection(){ data = new arraylist<>(); data_table = new hashtable<>(); } public void add(string key,t data){ this.data.add(data); data_table.put(key,data); } public t get(int index){ if(index >= data.size()) throw new indexoutofboundsexception(); return data.get(index); } public t get(string v){ return data_table.get(v); } public t next() { if( cursor == data.size()) throw new nosuchelementexception(); cursor++; return data.get(cursor-1); } public t first(){ cursor = 0; return data.get(cursor); } public boolean has

html - Trying to get drop down to appear when hovering single menu item, not entire menu -

Image
i have section flex box. trying drop down menu appear when mouse on vs div. unfortunately, div inside section tag , drop down menu won't appear. the way code set causes drop down menu appear when mouse on part of section. want drop down menu appear when mouse on vs. div. here image of section. .line { height: 4px; flex: 1; background: red; margin: 0 10px; } section { display: flex; align-items: center; } .home { margin-left: 50px; } .m { margin-right: 30px; } .logout { margin-right: 50px; } ul { list-style-type: none; margin-top: 20px; } .dropdown:hover ~ .dropdowncontent { display: block; } .dropdowncontent { display: none; } <section class="dropdown"> <div class="home">home</div> <div class="line"></div> <div class="m">reports</div> <div class="m dropdownvs">vs.</div> <div class="

python - How can I optimize my code for my Spanish Translation Program? -

i student obtaining bachelor's in computer science, , writing python program in little spare time have me learn spanish. it's not extravagant program i'm going publish or anything, me have fun , mess around with. learned basic gui structure of python programming tkinter, , trying pointed in right direction optimize code make smaller , not basic. have 3500 lines of code far, won't upload whole code, here structure of pretty entire program def _months( self ): #framework month window frame.__init__( self ) self.master.title( "months" ) self.grid() labelfont = ( "times", 18, "bold" ) homefont = ( "times", 10, "bold" ) self._monthmenuimage = photoimage( file = 'mexicowater.gif' ) self._monthbackgroundlabel = label( self, image = self._monthmenuimage ) self._monthbackgroundlabel.place( x = 0, y = 0 ) self.grid_propagate(0) self["height"] = 600 self["

c++ - Checking overflow for addc function -

i coding c++ program simulate 16 bit virtual machine. have function 'addc' in have check overflow. i'm little lost on conditions overflow. know overflow happens when add 2 positive numbers , negative number, or when add 2 negative numbers , positive number. however, in function addc, have 3 numbers have add. approaching correctly? my function supposed this: register destination = register destination + register source + carry bit (rd = rd + rs + c) so far checking overflow, have code.. //check when adding positive numbers gives negative result //my carry bit positive (either 0 or 1) if(rd >= 0 , rs >= 0 , c >= 0) , ((rd + rs + c) < 0)){ //set overflow bit } else if( rd < 0 , rs < 0 , c < 0) , (rd + rs + c) > 0) ){ //set overflow bit } my confusion else if condition. c 0 or 1, it'll never go else if loop, there's no reason have else if loop. doing right? or have add carry bit (c) 1 of operands (either rd or rs) have 2 o

SQL Server query to substr between 2 characters from end of the string -

i new sql. please help. i have table column values below xyz_3244h_v65_c005_z1234567455_p_f_20160127_0137.txt ertl_3244h_v65_c005_yiiuuuuuuab_1p_w_20160316_1227.txt wtern_3244h_vtwt05_twjeonsosjs_qwt_n_20160316_0937.txt i want query outputs z1234567455 yiiuuuuuuab twjeonsosjs i need extract value between 4th , 5th underscores counted reverse of string. please help. tia. using numbers table can accomplish this,all have create numbers table.. declare @string varchar(max) set @string='_'+'xyz_3244h_v65_c005_z1234567455_p_f_20160127_0137.txt'+'_' select substring (@string,n+1,charindex('_',@string,n+1)-n-1) numbers substring(@string,n,1)='_' , n<len(@string) you can use rownumber select values in place below.. select substring (@string,n+1,charindex('_',@string,n+1)-n-1),row_number() on (order charindex('_',@string,n+1)) rn numbers substring(@string,n,1)='_' , n<len(@string) the

operand should contain 1 column(s) subquery MySQL -

i have problem when make subquery select r.request_id, ( (select e.reportsto, (select e1.firstname employees e1 e1.nik = e.reportsto) firstname, (select e1.nik employees e1 e1.nik=e.nik) attention, (select e1.firstname employees e1 e1.nik=e.nik) attentionname employees e e.reportsto ='cs-nik-2016-0150' , e.nik='cs-nik-2016-0160') ) request r r.request_id='cs-req-bdg-201604-10099' operand should contain 1 column(s), why? use join instead of subquery. subquery may returns more 1 row,so shows error. avoid error use limit each of select not best solution,as in case return 1st row. select r.request_id, ( (select e.reportsto, (select e1.firstname employees e1 e1.nik = e.reportsto limit 1) firstname, e.nik attention, firstname attentionname employees e e.reportsto ='cs-nik-2016-0150' , e.nik='cs-nik-2016-0160') ) request r r.request_id='cs-req-bdg-201604-10099'

javascript - Click on the category list and get products using category id in angularjs -

i using intelxdk application. mobile application. my categorylist show, after click on that, have redirect product page, when click on category can error this. "can't find variable: $state". categorycontroller.js app.controller('categorycontroller', ['$scope','getservices','jsondataservice', function($scope,getservices,jsondataservice) { var url = 'http://look4what.biz/mobile/shop-category.php'; $scope.getid = function(termid){ jsondataservice.addtansferdata(termid); $state.go('/:id'); } getservices.sendrequest(url) .success(function(data, status, headers, config) { $scope.userslists = data; }) .error(function(data, status, headers, config) { }); }]); app.js var app = angular.module('lookapp', ['ionic','ngcordova','ngroute','paymentctrls']); app.config(function($stateprovider, $urlrouterprovider,$routeprovider) { $routeprovider .when(

python - Scrapy Incompatible library version -

i trying scrapy going on macbook however, after pip install scrapy , getting done, when import it gives me error importerror: dlopen(/library/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/lxml/etree.so, 2): library not loaded: libxml2.2.dylib reason: incompatible library version: etree.so requires version 12.0.0 or later, libxml2.2.dylib provides version 10.0.0 what should fix can started learning scrapy?? :(

unity3d - Randomize game objects actions, so they won't happen at the same time -

i wrote script change states npcs. run function return either true or false. if true, npc change state. all fine, except see more 1 npc acting @ same time, horrible. feels military squadron, synced. i use random value check if function should return true or false...but expecting see different results each npc, since random value in place class void npcstate() { private system.random rnd = new system.random(); private string state; void start() { state = "state1"; startcoroutine("runaction"); } ienumerator runaction() { ...do stuff every n cycles switch (state) { case "state1": ... go state 1 break; case "state2": ... go state 2 break; } } void state1() { ... execute tasks if (changeactiontype) { ...c

How to fill default parameters in yaml file using python -

i have yaml file content: image_name: ubuntu components: image_name: ubuntu image_flavors: [medium, large] image_ip : 192.168.12.134 imageuser : ubuntu image_pass : ubuntu image_config: /home/ubuntu/ image_net_type: vlan image_switch_type: ovs i have implemented script load yaml file , o/p have got in dict format. open("test.yaml", "r") input: try: = yaml.safe_load(input) print "parsing yaml file completed" print except yaml.yamlerror error: print(error) my dict format below: {'image_name': 'ubuntu', 'components': {'image_ip': '192.168.12.134', 'image_pass': 'ubuntu', 'image_switch_type': 'ovs', 'imageuser': 'ubuntu', 'image_name&#

c - How to calculate the value of coefficients in Auto-regressive model? -

Image
how calculate co-efficients (phi1, phi2..) in auto -regression linear equation above? please mention software using? assuming using r studio: summary(arima(x, order=c(1,0,0))$coefficients put dataset in place of "x".

javascript - jQuery reset a single table during onchange -

i have table follows. how reset table using jquery original state during on change(with th,tds). not reload entire page because have tables also. tried datatables adds search filters , paginations unnecessarily <table class="table table-bordered table-hover table-sm" id="t01"> <thead style="text-align:center"> <tr> <th class="col-md-6" style="text-align:center">dxx</th> <th class="col-md-2" style="text-align:center">rxx/unit</th> <th class="col-md-2" style="text-align:center">txxx</th> <th class="col-md-2" style="text-align:center">pxxx</th> </tr> </thead> <tbody> <tr> <th>full</th> <td id="fp" style="text-align:right">0</td> <td id="fr" style="te

Load Google Maps on webpage using Javascript and PHP through drop down form -

i having 2 drop down lists on html page. data coming mysql database , contains information latitude, longitude , address. user selects 1 item drop down , clicks on submit. at stage, want display google map , put marker @ latitude , longitude. then, when user selects option second drop down, want add marker on map. currently, able load map once clicks submit first drop down options tried drop pins not working. here code have achieved till now: <?php error_reporting(e_all); ini_set('display_errors', '1'); require_once('auth.php'); include ('loginconfig.php'); include ('fetchagentdetails.php'); include ('fetchdeliverydetails.php'); ?> <!-- change template, choose tools | templates , open template in editor. --> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

Missing Gemfile when using Docker on Heroku -

i trying out docker plugin heroku, locally start with. when run docker-compose web following error: building web step 1 : heroku/ruby # executing 7 build triggers... step 1 : copy gemfile gemfile.lock /app/user/ error: service 'web' failed build: lstat gemfile: no such file or directory this docker-compose.yml : web: build: . command: 'bash -c ''bundle exec puma -c config/puma.rb''' working_dir: /app/user environment: port: 8080 database_url: 'postgres://postgres:@herokupostgresql:5432/postgres' ports: - '8080:8080' links: - herokupostgresql shell: build: . command: bash working_dir: /app/user environment: port: 8080 database_url: 'postgres://postgres:@herokupostgresql:5432/postgres' ports: - '8080:8080' links: - herokupostgresql volumes: - '.:/app/user' herokupostgresql: image: postgres why gemfile missing, importantly how should docker?

video - Android ffmpeg Output Error -

i using https://github.com/writingminds/ffmpeg-android-java to run ffmpeg commands on android. trying overlay image on video. reason, following error when execute command. ffmpeg -i input.mp4 strict -2 -i overlay.jpg -filter_complex [0:v][1:v] overlay=25:25:enable='between(t,0,4)' output.mp4 output file #0 not contain stream could me out? in advance! i facing same issue , problem was: calling execute method wrong way. string array passing this: final string[] cmd = new string[] { "-i input.mp4 strict -2 -i overlay.jpg -filter_complex [0:v][1:v] overlay=25:25:enable='between(t,0,4)' output.mp4" }; the correct way create array, though, split command in separate strings: final string[] cmd = new string[]{ "-i", "input.mp4", "strict", "-2", "-i", "overlay.jpg", "-filter_complex", "[0:v][1:v]", "overlay=25:25:enable='between(t,0,4)&#

annotations - How to open RECORD.alM file from mimic2db in Cygwin? -

i try open annotation file mimic2 db patient a40017 called a40017.alm. have link data: http://www.physionet.org/pn5/mimic2db/a40017/ , don't find exact command in cygwin export file csv or text. i try use command: rdann -r mimic2db/a40017/a40017 -f 0 -t 216647.728 -a alm -v >annotations.txt got empty file is know how can that? thanks, gal anwering myself. rdann mingw32/64 program https://physionet.org/physiotools/binaries/windows/ if in same directory of program , not in path need run: ./rdann -r mimic2db/a40017/a40017 -f 0 -t 216647.728 -a alm -v or /<fullpath>/rdann ...

php - Mysql query error when using ">" operator -

i want output mysql database json. there problem in code. problem if put 0,1,2,3 or 4 here tbl_stock.qty> ? ,no output given. if put 5 or higher number 5 gives me output. my php code <?php require_once 'include/configg.php'; header('content-type: application/json'); $con = mysql_connect(db_host, db_user, db_password) or die("connection failed"); mysql_select_db(db_database,$con) or die("db selection failed"); $r=mysql_query("select tbl_stock.matnum, tbl_stock.sorg, tbl_stock.qty, tbl_mas_material.matname, tbl_mas_material.matgrp tbl_stock inner join tbl_mas_material on tbl_stock.matnum = tbl_mas_material.matnum tbl_stock.qty> 0"); $result = array(); while($row=mysql_fetch_array($r)){ array_push($result, array('matnum'=>$row[0], 'sorg'=>$row[1],'qty'=>$row[2],'matname'=>$row[3],'matgrp'=&g

Visual C# check type of array elements with lambda expression -

i have array contains various type of elements. i trying construct lambda expression evaluate if clause true if specific type exists in array. i trying following , many different approaches don't seem right: var arraysourcetext = editorcontroller.activedocument .activesegmentpair .source .allsubitems .toarray(); if (arraysourcetext.any(o => o.gettype()) == typeof(string)) { intstartingph++; } any advice welcome. note: arraysourcetext api ienumerable custom types. assumed string simplicity in pseudocode. update: because type not exposed api, name of type, workaround based on byyo's correction. wrote separate method check name of type , return bool : var arraysourcetext = editorcontroller.activedocument .activesegmentpair .sour

c# - Entity Framework Code First Database Initialization with relations -

i'm working on n-teir project , question focusing on service (buisness logic) , data layers. have in data layer, 3 models: aircraft, aircrafttype, , aircraftlivery. have pretty idea of how initialize database sample data, i'm unsure of how relate different types. how create livery , relate aircraft, or default livery of aircraft type? how relate aircraft type aircraft? below current code builds havn't ran yet. how implement last class, sample data? there else in code see done differently? in data layer: public abstract class modelbase { [key] public int id { get; set; } public string lastupdateuser { get; set; } public datetime lastupdatedt { get; set; } public bool isdeleted { get; set; } } public class aircraft : modelbase { public guid serialnumber { get; set; } public string registration { get; set; } public byte[] image { get; set; } [foreignkey("id")]

Address of function pointers in C++ -

this question has answer here: how print function pointers cout? 6 answers i'm not clear on values being returning calling: &next, fp, *fp, &return_func_ptr, fp_ptr, &fp_ptr, *fp_ptr they seem give me value 1 . mean? also, how declare int (*return_f())(char) to receive parameter without using typedef? #include <iostream> int next(int n){ return n+99; } // returns pointer function typedef int (*fptr)(int); // using typdef fptr return_func_ptr(){ return next; } int f(char){ return 0; } int (*return_f())(char){ // how pass parameter here? // std::cout << "do " << param << std::endl; return f; } int main() { int x = 5; // p points x int *p = &x; std::cout << "x=" << x << std::endl; // 5,

wpf - Use CollectionViewSource with TabControl -

i'm trying group , display items of observablecollection, using xaml code. works using simple collectionviewsource , listbox[1]. actually, prefer display group's content in tabcontrol. google led me following social.msdn article wich presents workaround display groups tabcontrol using code behind: https://social.msdn.microsoft.com/forums/vstudio/en-us/e073f275-0826-4fca-b9da-e310ccf1713e/wpf-grouping?forum=wpf however, i'm using mvvm , must rely on xaml only, can't work. actually, collectionviewsource populates groups (the tabcontrol shows correct tabitemheaders), clicking on of these tabitems freezes application. here's i've tried: <stackpanel x:key="modulselectinputparameterview"> <stackpanel.resources> <collectionviewsource x:key="cvs" x:name="collectionviewsource" source="{binding referencedlmtitem.modulinputparametercollection }"> <collectionviewsource.group

python - why built in function next(iter_obj) when we have method iter_obj.next() -

this question has answer here: why did python 2.6 add global next() function? 3 answers i'm new python ,and trying figure out why 2 ways? specific reason? 1 better? i've tried searching not able find it. the simplest answer justification similar next(x) len(x) . fredrik lund summarises guido's response on topic in this article .

algorithm - How to find difference of two voice files using python -

i want 2 compare 2 voice file , find difference between them, spouse have original file of music track , file readout of music me, want 2 compare these 2 musics , find difference between phonemes, words aren't important me, important thing similarity in phonemes , want find percentage of similarity. prefer implement python. you try audio fingerprinting using fpcalc in chromaprint. chromaprint core component of acoustid project. audio fingerprinting done using fpcalc in chromaprint. fpcalc should placed in same directory python script. python bindings chromaprint acoustic fingerprinting , acoustid api. https://pypi.python.org/pypi/pyacoustid bellow example article python demo code. comparing non-identical audio files duplicate content cross-correlated fingerprints http://www.randombytes.org/audio_comparison.html how chromaprint work? http://oxygene.sk/2011/01/how-does-chromaprint-work/

android - Animate ImageView when sliding to fill width -

i trying achieve animation 1 now playing page where after sliding up, album art stretches fill width. efficient way of achieving this? if in same view, have @ http://developer.android.com/reference/android/transition/transitionmanager.html allows transition between 2 layouts in same activity or fragment . if you're adding new fragment, want override transition, : getfragmentmanager().begintransaction() .setcustomanimations(r.animator.fragment_slide_up, r.animator.fragment_slide_down) finally if you're switching activities, want have @ http://developer.android.com/training/material/animations.html (part 3 activity transitions , shared elements)

ms access - sql using Count(*) function -

Image
i using microsoft access 2013 , i'm trying find number of orders in each cafe number shown wrong. code: select avg(feedback.ratingforexperience) caferating, count(tblorder_product.productcode) cafesales, feedback.cafeid tblorder_product, feedback group feedback.cafeid; please me, thank you. screen1 [ as mentioned in comments, need join tables together. below sql. select avg(feedback.ratingforexperience) caferating, count(tblorder_product.productcode) cafesales, feedback.cafeid tblorder_product inner join feedback on tblorder_product.ordercode = feedback.ordercode group feedback.cafeid; or select avg(feedback.ratingforexperience) caferating, count(tblorder_product.productcode) cafesales, feedback.cafeid tblorder_product left join feedback on tblorder_product.ordercode = feedback.ordercode group feedback.cafeid;

c++ - Trying to make a simple recursion exercise -

hi im trying create function : double harmonicsum(int n) calculates , returns sum 1 + ½ + 1/3 + ... + 1/n this code double harmonicsum(int n) { if(n==1) return 1; return (1.0/n) + (1.0/(harmonicsum(n-1))); } it doesnt work . if call harmonicsum(1) or harmonicsum(2) works , harmonicsum(3) no . correct code double harmonicsum(int n){ if(n==1) return 1; return (1.0/n) + harmonicsum(n-1); } simply try below double hermonic(int n) { if(n==1) return 1 ; else return ( float ) 1/n + hermonic(n - 1) ; }

jquery - How to replace between existing table rows in JavaScript -

i trying regenerate table new order, problem encounter in performance, have this: <table> <tr id="row1"></tr> <tr id="row2"></tr> <tr id="row3"></tr> <tr id="row4"></tr> </table> obviously table more complex, solution performance replacing command target table should like: <table id="maintable"> <tr id="row3"></tr> <tr id="row4"></tr> <tr id="row1"></tr> <tr id="row2"></tr> </table> when redraw performance bad(for more 100 lines) there way replace rows between without redrawing it? thanks for rearranging them append them using append() or next() $table = $('#maintable'); $table.append($('#row1,#row2', $table)); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"><

Create Azure AD Application Graph API Key using PowerShell -

is there way create azure ad app graph api key using powershell shown below? i saw articles create certificate first how azure generating key app without asking certificate when manually? want create same key azure doing using powershell. azure ad application graph api key thanks,

javascript - tracking user input and offer word completion- angular -

i new in angular , need help. lets have db contains list of numbers , want use list word completion. assume form: <!-- form --> <form> <!-- code --> <label>code</label> <input type="text" name="codeinput" placeholder="please insert code..." > <!-- submit button --> <button type="submit" >submit </button> </form> upon user inserts @ least 5 chars want make ajax call offers.php retrieve offers , display them. note ajax call before submitting form the php code working... stuck on client side. i know should like: $http({ method : 'post', url : 'offers.php', data : $.param(code), headers : { 'c

html - Different behavior on <pre><code> -

i using google prettify highlight code on website. html 5 conform use: <pre class="prettyprint"><code class="language-java"></code></pre> to modify used font , size added css: code { font: normal 400 1.2rem/1.5 'roboto mono', monospace; } i tested ie-edge , firefox , fine. later have seen, chrome accepting font(-family) not size (bigger expected). while ie , firefox inherited the size <html> expected. meanwhile made small workaround , additionaly added: pre { font: normal 400 1.2rem/1.5 'roboto mono', monospace; } using <pre> alone no option, because ie , firefox don't accept font(-family), while chrome does, makes size smaller expected. that ie has different behavior other browsers known, in case chrome acts differently. redundant code used in pre and code the "solution here? <pre> , <code> both part of html 5 spec. there no need use both. sorry, misunderstood

objective c - How to update Read and Delivery status of sent and received messages using Quickblox IOS? -

i have implemented chat sample app using quickblox,and followed samplechat app provided quckblox(urls provided below). want update read , delivery status of each message. how achieve this? http://quickblox.com/developers/simplesample-chat_users-ios https://github.com/quickblox/quickblox-ios-sdk/tree/master/sample-chat in link 1 have explained code i'm unable implement. there docs read , delivered status in link provided. to make answer more explicit, there several ways mark messages read , delivered. delivered marking there xmpp way available, use method qbchat it: /** * send "delivered" status message. * * @param message qbchatmessage message mark delivered. * @param completion completion block failure error. */ - (void)markasdelivered:(qb_nonnull qbchatmessage *)message completion:(qb_nullable qbchatcompletionblock)completion; for read marker can use either rest request using qbrequest method: /** mark messages read. @note

video - Qt QML Mediaplayer Source Address for root file system -

i try play video using qml mediaplayer. qt version 5.3.1 , code use is: mediaplayer { id: mediaplayer source: ./video.mp4 loops: mediaplayer.infinite onerror: { console.debug("mediaplayer video error\n"); console.debug(errorstring); } onplaying: { console.debug("mediplayer plays, hasvideo: ", hasvideo, "\n"); console.debug("videoplayer source address: ", source, "\n"); } } i want play video located under directory same qt app. when playback starts get: mediplayer plays, hasvideo: false videoplayer source address: qrc:///video.mp4 i have tried give source path this: source: qt.resolvedurl("./video.mp4") but result doesn't change. if try play video qrc giving source url as: source: "qrc:///video.mp4" it logs: mediplayer plays, hasvideo: false videoplayer source address: qrc:///video.mp4

lambda - Java 8 streams reduce and combine List items to Map -

i need create map keys of name1/2 summing values value1/2. what cleanest way rewrite using java 8 streams? class item { private string name1; private integer value1; private string name2; private integer value2; public item(final string name1, final integer value1, final string name2, final integer value2) { this.name1 = name1; this.value1 = value1; this.name2 = name2; this.value2 = value2; } //getters , setters } list<item> list = lists.newarraylist( new item("aaa", 1, "bbb", 2), new item("bbb", 5, "ccc", 3), new item("aaa", 8, "bbb", 7), new item("bbb", 2, "aaa", 5)); map<string, integer> map = maps.newhashmap(); (item item : list) { map.merge(item.name1, item.value1, integer::sum); map.merge(item.name2, item.value2, integer::sum); } system.out.pr

php - I'm getting an Array to string conversion when trying to get a column from a stored procedure using Laravel 5.2 -

Image
i've been struggling while now, thought post here , see if has solution why it's throwing array string conversion exception. here code: model public function getpackagereference(request $request) { $package_reference = $request->input("package_reference"); $result = db::select("call getpackagereference(?)", array($package_reference)); return $package_reference .$result; } stored procedure: delimiter // create procedure getpackagereference (in package_reference_param varchar(20)) begin select lpad(cast((count(distinct package_reference) + 1) char(3)), 3, '0') package_reference package package_reference concat(package_reference_param, '%'); end // delimiter ; stored procedure result: call getpackagereference('t2agb') so in model return package_reference value. cheers, tim the $result variable array , typing $package_reference .$result want convert string , that's causing

asp.net mvc - How to refresh partial view by another partial view without scripting? -

i want refresh partial view partial view. structure i want update 3rd partial view on submit of first partial view i rendering first partial main index view using @{html.renderaction("searchmenu", "search");} you have use ajax it, don't think there other possible solution it, can check out answer: how update partial view partial view via action results hope it'll work

regex - W3C: Can't read EBNF's SPARQL IRIREF specification? -

(specifications: https://www.w3.org/tr/sparql11-query/#ririref ) according specification, iriref can parsed this: [139] iriref ::= '<' ([^<>"{}|^`\]-[#x00-#x20])* '>' what bothering me part of expression: \]-[ if consider \ escaping character in bracketed character class (which case in perl regular expression), means \ alone not problem in iriref , valid: <http://hello\world> then there big problem range: ]-[ . character ] has ordinal value of 93 , [ of 91. means have invalid range: 93 92. not allowed in regex engines tested. what means? should consider - regular character in bracketed character class, invalid iriref: <http://new-example.org> . makes no sense. should consider range ]-[ null , iriref valid: <http://hello[world]> what think more range inverted , not problem w3c specifications, means characters [ , \ , ] invalid characters. makes sense. the sparql spec says grammar written u

javascript - Angular resolve is rejected, but page is still loading -

this resolve function works everywhere else, , i'm stumped why profile page still executing when promise rejected. produced bug logging in, deleting token storage , trying navigate profile page. goes through authentication steps, , logs out. hits redirection line, still loads profile page, throwing errors because auth has been cleared. any can offer great. let me know if need more info. app.config('$routeprovider') .when('/profile', { templateurl: '/templates/profile.html', controller: 'profilecontroller', resolve: { auth: function (sessionservice) { sessionservice.resolve() } } }). otherwise({ redirectto: '/login' }) function resolve () { if (self.isauthenticated()) { return $q.when({auth: true}) } else { $q.reject({auth: false}) self.logout() // first go here } } } function logout () { var auth = self.storage() if (...) {