Posts

Showing posts from January, 2014

Javascript / Jquery Help - Calling functions from select menu -

i need adding interactivity page. i'm new jquery , stuff simple been driving me nuts! its footy team different players details stored in objects in array called squad_list squad_list.js var squad = [ { number: 1, pic: 'img/hibberd_m_t.png', name: 'michael', surname: 'hibberd', height: '186 cm', weight: '86 kg', debut: 2011, position: ['defender'], games: 85, goals: 11 }, { number: 2, pic: 'img/bellchambers_t_t.png', name: 'tom', surname: 'bellchambers', height: '202 cm', weight: '106 kg', debut: 2008, position: ['ruck'], games: 79, goals: 53 }, { number: 3, pic: 'img/chapman_p_t.png', name: 'paul', surname: 'chapman', height: '179 cm', weight: '87 kg', debut: 2000, position: ['foward'], games: 280, goals: 366, goals15: 8 }, ]; etc etc i have differe...

ios - How to fetch a list of items in a column from Parse cloud using swift -

i beginner ios swift , presently working parse cloud. need fetch contents of complete column list class named "student". looking print list of roll numbers student class. my current code this: @ibaction func btn_download(sender: anyobject) { var compquery = pfquery(classname:"student") compquery.wherekey("roll", equalto:enter_rollnumber.text) compquery.findobjectsinbackgroundwithblock { (student: [anyobject]!, error: nserror!) -> void in if error == nil { // found objects competition in student { println(competition["name"] string) self.display_name.text = competition["name"] string? } } else { // log details of failure println("error") } }}

javascript - Track page download time for different pages for analytic purposes -

Image
i trying build analytic system tracks performance of pages of websites. the website content-driven same template used pages. right use @ page start: var time = date.now() ...and @ end of page use this: date.now - time ...and send difference tracking api, stores data. could please suggest better way, did not find reviews method. the navigation timing api provides data can used measure performance of website. unlike other javascript-based mechanisms have been used same purpose, api can provide end-to-end latency data can more useful , accurate. function onload() { var = new date().gettime(); var page_load_time = - performance.timing.navigationstart; console.log("user-perceived page loading time: " + page_load_time); } there many measured events given in milliseconds can accessed through performancetiming interface: for details see http://www.w3.org/tr/navigation-timing-2/ or experiment window.performance object. actually recommend us...

javascript - Showing and hiding text in response to a button click -

the code below this. when click button first time, shows respective text. , when click same button again, fades out , fades in. however, want respective text disappear if button clicked second time instead of fading out , fading in. $(document).ready(function(){ $('.info').click(function(){ $(this).next().fadeout("slow"); $(this).next().fadein("slow"); }); }); html: <div> <a class="info" p style="font-size:30px" href="javascript:void(0);">header 1</a> <h1 class="infotext" style="display:none">text 1</h1> </div> <div> <a class="info" href="javascript:void(0);">header 2</a> <h1 class="infotext" style="display:none">text 2</h1> </div> <div> <a class="info" href="javascript:void(0);"...

Git for visual studio 2008 -

i did migration svn git . have seen built in svn visual studio 2008 . is there built in git available visual studio 2008 or let me know best way work. take @ git extention , more explaination on this question .

xcode - Access button from different controller (Objective-C) -

i've started making app in xcode need access button on different controller. can set controllers class viewcontroller first one? or need create new class , link them how? you can pass object of interest view controller view controller b this: // in view controller - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { if([[segue identifier] isequaltostring:@"seguefromatob"]) { nsstring *myvalue = [_mytextfield text]; [(bviewcontroller *)[segue destinationviewcontroller] setmyvalue:myvalue]; } } // in view controller b @interface bviewcontroller () @property (nonatomic, strong) nsstring *myvalue; @end - (void)viewdidload { [super viewdidload]; // todo: evaluate myvalue here } don't forget give segue (represented line connecting 2 controllers) b id in storyboard (e.g. "seguefromatob")

java - How to manage sessions in a distributed application -

i have java web application deployed on 2 vms. , nlb (network load balancing) set these vms. application uses sessions. confused how user session managed in both vms. i.e. example- if make request goes vm1 , create user session. second time make request , goes vm2 , want access session data. how find session has been created in vm1. please me clear confusion. there several solutions: configure load balancer sticky: i.e. requests belonging same session go same vm. advantage solution simple. disadvantage if 1 vm fails, half of users lose session configure servers use persistent sessions. if sessions saved central database , loaded central database, both vms see same data in session. might still want have sticky sessions avoid concurrent accesses same session configure servers in cluster, , distribute/replicate sessions on nodes of cluster avoid using sessions, , use signed cookie identify users (and possibly contain few additional information). json web token solutio...

mobile - What's the Facebook/AirBnb app design effect called? -

i want read effect see on pages facebook or airbnb when open page , browser shows low fidelity design of page while actual data loads - you'll see grey box instead in place pictures of users be, grey rectangles instead of text content etc. i've been searching hours cannot find useful, knows name of ux practice? i believe referred loading dummy content. there wasn't info when searched it, know basic principle first load gray background images , dummy block font wait content render.

symfony - Symfony2 security different firewalls don't redirect properly to login -

i configured 3 secured areas based on user type: admin, teacher , student. when i'm accessing /admin, i'm redirected /admin/login. when i'm accessing /teacher or /student redirection fails, although i'm being redirected /teacher/login or /student/login i'm getting error: the page isn't redirecting properly firefox has detected server redirecting request address in way never complete. this security.yml: firewalls: # disables authentication assets , profiler, adapt according needs dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false admin: pattern: ^/admin form_login: check_path: login_check login_path: /admin/login provider: chain_provider csrf_provider: form.csrf_provider default_target_path: /admin logout: true teacher: pattern: ^/teacher form_login: check_path: login_check...

jquery - How to render another page (Controller Action + View) inside current view -

Image
let's have userprofilecontroller#show renders user's profile account page. associated views , partials controller under /app/views/user_profile/* as userprofile page, user should able edit preferences. done clicking preferences link triggers userpreferences#show , displays whole new page rendering views under /app/views/user_preferences/* my current issue latter page whole separate page have link to. i'd love instead able bring preferences page in modal without leaving user profile page. or maybe want embedded in profile page @ bottom (i.e. doesn't have popup modal - wasn't looking specific answer that). the issue have no way call whole new controller , action current userprofilecontroller view. there way call new route , have generate whole new page within current page? the answer i've received far should consider doing same controller, that's overloading userprofilecontroller , action method becoming long , messy. thanks! you...

c# - WPF selecteditem value binding -

i have combobox binded dictionary dictionary: public dictionary<string,datetime> timeitems { get; set; } <combobox grid.column="3" horizontalcontentalignment="center" verticalcontentalignment="center" itemssource="{binding timeitems}" selectedindex="0" selecteditem="{binding selecteditem}"> how can bind public datetime selecteditem { get; set; } value of timeitems you can use converter bind the value of dictionary selecteditem. public class dictionaryvalueconverter : ivalueconverter { public object convert(object value, type targettype, object parameter, system.globalization.cultureinfo culture) { return value; } public object convertback(object value, type targettype, object parameter, system.globalization.cultureinfo culture) { return ((keyvaluepair<string, datetime>)value).value; } } xaml <combobox grid...

javascript - formatSelection not working in select2.js -

i using select2.js populate field multiple values using ajax call. below code using. html <input id="id_test_name" class="form-control"> script <script type="text/javascript"> $("#id_test_name").select2({ placeholder: "search item", minimuminputlength: 2, ajax: { url: "/resourse/?format=json&name=xyz", datatype: 'json', quietmillis: 100, data: function (term, page) { return { option: term }; }, results: function (data, page) { return { results: $.map(data.results, function (item) { return { name: item.name, abbreviation: item.abbreviation, id: item.id } ...

c++ - How to use a member variable in a base class function when its size is only known to the derived class -

i want implement function in baseclass uses members of derived classes. each derivedclass, have member of different value. here's example. baseclass has member function foo() uses variable arrstr . content of nul terminated char array found in derived class. how can make baseclass "know" variable arrstr without knowing size? possible? class baseclass { public: baseclass(); ~baseclass(); protected: void foo() { prtinf("%s\n", arrstr); }; }; class derivedclass : public baseclass { public: derivedclass(); ~derivedclass(); protected: char arrstr[] = "foostring!"; }; add (pure) virtual access functions in base class implement in derived class. #include <iostream> #include <string> class baseclass { protected: void foo() { std::cout << getstring() << std::endl; } ...

javascript - handsontable formula returning #NEED_UPDATE -

i have handsontable, example: +---+------+-------+-------+ | | | b | c | +---+------+-------+-------+ | 1 | 10 | 20 | 30 | +---+------+-------+-------+ | 2 | 5 |=0.5+a3|=0.5+b3| +---+------+-------+-------+ | 3 |=a1+a2|=b1+b2 |=c1+c2 | +---+------+-------+-------+ when table loaded, b2 , c2 has value of #need_update instead of calculation result of formula. how handle issue? nevermind, solved this. add afterrender callback: afterrender: function(){ this.setdataatcell(row, col, formula); } this automatically update cell right.

excel - Copy to last non-empty cell in a row -

i want copy data specific range last active cell in specific row right use code: wrkbook1.sheets("sheet1").range("a" & cells.rows.count).end(xlup).copy it copies last active cell this many lines put comment because have make sure cells inside range same worksheet. 'copy of sheet1 columns wrkbook1.sheets("sheet1") .range("a1:a" & .cells(rows.count, 1).end(xlup).row).copy end 'paste next blank row in sheet2 column wrkbook1.sheets("sheet2") .cells(rows.count, 1).end(xlup).offset(1, 0).pastespecial end

hadoop - Convert date with milliseconds using PIG -

really stuck on this! assume have following data set: a | b ------------------ 1/2/12 | 13:3.8 04:4.1 | 12:1.4 15:4.3 | 1/3/13 observations , b in general in format minutes:seconds.milliseconds click , b response. time format has form of month/day/year if of events happens in beginning of new day. what want? calculate average difference between b , a. can handle m:s.ms splitting them 2 parts each , b , cast double , perform needed operations fails when m/d/yy introduced. easiest way omit them not practice. there clear way handle such exceptions using pig? a thought worth contemplating .... ref : http://pig.apache.org/docs/r0.12.0/func.html string , date functions used. input : 1/2/12|13:3.8 04:4.1|12:1.4 15:4.3|1/3/13 pig script : a = load 'input.csv' using pigstorage('|') (start_time:chararray,end_time:chararray); b = foreach generate (indexof(end_time,'/',0) > 0 , last_index_of(end_time,'/') > 0 , (indexof...

How can I access to a public final static list declared into an utility class from another class in a Java application? -

i have following doubt. java application have utility class this: public class codutility { /* tipologia progetto */ public static final string codice_progetto_wifi = "w"; public static final string codice_progetto_lim = "l"; public static final string codice_progetto_altro = "a"; public static final string codice_progetto_classi20 = "2"; public static final string codice_progetto_scuola20 = "s"; public static final string codice_progetto_csd = "c"; public static final linkedhashmap<string, string> hashmapdescrizionetipologiaprogetto = new linkedhashmap<string, string>(); static { hashmapdescrizionetipologiaprogetto.put(codice_progetto_wifi, "wifi"); hashmapdescrizionetipologiaprogetto.put(codice_progetto_lim, "lim"); hashmapdescrizionetipologiaprogetto.put(codice_progetto_altro, "altro"); hashmapdescrizionetip...

Different with Microsoft Azure AD Module PowerShell and Microsoft Azure Powershell -

Image
i try run command set-msoldomainauthentication microsoft azure active directory module windows powershell. exception, when try connect azure account( connect-msolservice ). type email , password, get: i try find solution in google, azure support find useless. on system, have application called microsoft azure powershell link . in app, can connect azure account, through command add-azureaccount . time, don't find analogue set-msoldomainauthentication . this command exists in azure powershell? can change azure ad other way, command set-msoldomainauthentication ? maybe azure admin panel? or graphapi ? i had similar issue powershell. exception getting when try logging credential account microsoftlive. powershell required account in domain. so: create new user in azure domain in role globaladmin, change password user, logging in office365, enter powershell credential user. good luck.

Windows Phone Device Registration -

trying register windows phone 8 device development using development registration tool on windows 8. unfortunately, says have verify account using code. problem code being sent email not active. there way can change account selects send code to? automatically says send code email account. i've tried restarting machine , doesn't seem make difference. thanks in advance. yes but, first have reactive account. sign in active account ask you sure want reactivate account ? check yes , after can change secondary account settings.

excel - Vlookup error in the first parameter -

i have problem in code. want value sheet , copy in active sheet problem condition inside loop.it gives me error in vlookup line. can detect me error: with thisworkbook.sheets("plan traitement risque") = 6 lr1 step 1 'test si valeur cellule feuil1!=ax est dans plage col_2(feuil2!a1:a50)) if application.countif(col_2, .range("b" & i).value) = 0 cells(i, 3).select activecell.formula = "=vlookup(cells(i, 2).value,'scénarios de menace'!$b$6:$n$700,2,false)" end if next end the active cell formula built string. if want pass vba function cells(a, b).value string, need concatenate other parts of string, this: activecell.formula = "=vlookup(""" & cells(i, 2).value & """,'scénarios de menace'!$b$6:$n$700,2,false)" edit: added quotes accommodate string in cells(i,2), suggested in comment jeeped.

How to make button like this in Android? -

Image
i trying implement button in android following layout.how make it?? i have implemented button i used following code make <textview android:id="@+id/action_text_share" style="@style/mediumtextsize" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginleft="5dip" android:gravity="center" android:singleline="false" android:text="share text" android:padding="10dp" android:layout_weight="1" android:background="@drawable/white_broder_round_with_transparent_bg" android:textcolor="@color/blackcolor" /...

If-statement not working Javascript -

okay, here code. .ajax({ type:"post", url: "data.php", data:{ number:number, sprint_count:sprint_count }, datatype: 'json', success: function(data){ var count = data.length; var plannedsprint = 0; for(var = 0; i<count; i++){ var column = data[i].column; if(plannedsprint !== data[i].plannedsprint){ $("#div"+column+"_"+team).append(data[i].plannedsprint); } var plannedsprint = data[i].plannedsprint; var team = data[i].team; var element = data[i].element; $("#div"+column+"_"+team).append(element); } } }); i want if-statement work long data[i].plannedsprint isn't same plannedsprint . reason if-statement isn't working. why so, wrong if-stateme...

utf 8 - using PHP explode() of a unicode string to get the rows in an array -

i trying read tab delimited spreadsheet unicode characters this: $content = file_get_contents($filename); when print in browser texts shown correctly. there header: header('content-type: text/html; charset=utf-8'); now want split content rows using: $rows= explode("\n",$content); the content unicode characters gibberish when instance print 1 row: echo $rows[1]; my question is: causing behaviour , can correct texts $row array? in end want insert row values database, inserts gibberish. help appreciated example a row before explode() looks (note: tabs not displayed below): r002 Студия 2В 66 Богдан дорога Санкт-Петербург 3174 45 Андрей Смирнов маркетинг 234-56790 653-23685 dummy@dummy.com 34354547 after explode row looks like: r002 ! b c 4 8 o 2 66 > 3 4 0 = 4 > @ > 3 0 ! 0 = : b -¬ 5 b 5 @ 1 c @ 3 3174 45 = 4 @ 5 9 ! < 8 @ = > 2 < 0 @ : 5 b 8 = ...

swift2 - Can't match on enum without using value -

i've updated project use swift 2. i've come across silly situation switches. here's simple example. enum x { case asint(int) case asbool(bool) } g() -> x { // ... } f() -> bool { let local = g(); switch local { case .asint(let x) return true; case .asbool(let bool) return false; } } the swift compiler complains (warning) x unused, is. tells me replace _ . fine, replaced _ . swift compiler complains (warning) let binding binds no variables. fine, removed it. swift compiler throws error complaining tuple pattern doesn't match. how match on enum without using value or getting bunch of pointless warnings/errrors recommended fix not fix anything? func f() -> bool { switch g() { case .asint: return true case .asbool: return false } }

java - Neo4j not starts -

i'm trying run neo4j database java gives me following error : java.lang.runtimeexception: error starting org.neo4j.kernel.embeddedgraphdatabase, /home/matteo/neo4j-community-2.2.2/data/graph.db @ org.neo4j.kernel.internalabstractgraphdatabase.run(internalabstractgraphdatabase.java:334) @ org.neo4j.kernel.embeddedgraphdatabase.<init>(embeddedgraphdatabase.java:59) @ org.neo4j.graphdb.factory.graphdatabasefactory.newdatabase(graphdatabasefactory.java:108) @ org.neo4j.graphdb.factory.graphdatabasefactory$1.newdatabase(graphdatabasefactory.java:95) @ org.neo4j.graphdb.factory.graphdatabasebuilder.newgraphdatabase(graphdatabasebuilder.java:176) @ org.neo4j.graphdb.factory.graphdatabasefactory.newembeddeddatabase(graphdatabasefactory.java:67) @ getter.main(getter.java:46) caused by: org.neo4j.kernel.lifecycle.lifecycleexception: component 'org.neo4j.kernel.extension.kernelextensions@2e9a2123' failed initialize. please see attached cause exc...

javascript - Skype SDK entry point to sign in a user error: NoFQDN -

i'am trying sign skype via use of sdk keep hitting following error, "error: nofqdn". after searching on net can't find possible solution or find out error means. can shed light on or point me towards useful sources? appreciated, thanks. this javascript i'm using try , log skype with. /** * script demonstrates how sign user in , how sign out. */ $j(function () { 'use strict'; // create instance of application object; // note, different instances of application may // represent different users var application var client; skype.initialize({ apikey: 'swx-build-sdk', }, function (api) { application = api.application; client = new application(); }, function (err) { alert('some error occurred: ' + err); }); // when user clicks on "sign in" button $j('#signin').click(function () { // start signing in client.signinmanager.signin(...

asp.net - How to match only month and year part from datetime column in SQL Server -

i have 2 inputs, month , year. selectedmonth = ddlmonth.selecteditem.value;//1 selectedyear = ddlyear.selecteditem.text.trim();//2013 i want show records preset or not of particular month , year instead of date. want show registered employee sql query select e.enquiryid, registrationnumber, name branch b left join enq e on b.enqui = e.enqu reg = @regno , pay=cheque i need if selected month =1 ad year=2015. if present in payment date , cheque. like: where registratio = @regno , payment(month) = selectedmonth , payment(year) = selectedyear , chequere(month) = selected month , chequere(year) = selected year my columns chequere , payment date in datetime format. the efficient way construct date within application code: selectedmonth = ddlmonth.selecteditem.value;//1 selectedyear = ddlyear.selecteditem.text.trim();//2013 var date = new datetime(int.parse(selectedyear), int.parse(selectedmonth), 1); then pass date parameter query: where ...

.htaccess - Redirect urls of a blog - htaccess -

my questions simple, how can redirect kind of urls : www.domain.com/?page_id=25&id=46 : www.anotherdomain.com/ when try : rewritecond %{http_host} ^domain\.com$ [or] rewritecond %{http_host} ^www\.domain\.com$ rewriterule ^/?$ "http\:anotherdomain.com\" [r=301,l] the url redirected http:anotherdomain.com\?page_id=25&id=46 and redirection need redirect : blog1.domain.com anotherdomain.com knowing there multiple blocks. thanks help, best regards. rewriteengine on rewritecond %{http_host} ^(www|blog1)\.domain\.com$ [nc] rewriterule ^ http://www.anotherdomain.com/? [r=301,l]

objective c - IOS: how to use UITableView as Newsfeed view for Facebook like application -

i working on facebook app in have view friends updates on newsfeed same facebook. app's newsfeed using uitableview confused how design dynamic table view calls newsfeed shows texts , images separately or in same cell. please suggest me solution you need subclass uitableviewcell create custom uitableviewcell. http://code.tutsplus.com/tutorials/ios-sdk-crafting-custom-uitableview-cells--mobile-15702

sdk - How to modify an invoice in quickbooks using qbxml and qbsdk13 in c#? -

i have done invoicemodquery <?xml version="1.0" ?> <?qbxml version="6.0"?> <qbxml> <qbxmlmsgsrq onerror="stoponerror"> <invoicemodrq requestid="1"> <invoicemod> <txnid>79-1442638826</txnid> <editsequence>1442638826</editsequence> <customerref> <listid>80000004-1442638803</listid> <fullname>chris evans</fullname> </customerref> <txndate>2015-09-19</txndate> <refnumber>5461</refnumber> <invoicelinemod> <itemref> <listid>8000000a-1442469770</listid> <fullname>item 1</fullname> </itemref> <quantity>1</quantity> <rate>100.00</rate> </invoicelinemod> <invoicelinemod /> <invoicelinemod> <itemref> <listid>8000000b-1442469788</listid> <fullname>item 2</fullname> ...

ios - Swift : Modifying UISearchBar Cancel button font text color and style -

this question has answer here: change uibarbuttonitem uisearchbar 2 answers how can change text font , color of uisearchbar cancel button in swift ? may you. let cancelbuttonattributes: nsdictionary = [nsfontattributename: font_regular_16!, nsforegroundcolorattributename: color_blue] uibarbuttonitem.appearance().settitletextattributes(cancelbuttonattributes, forstate: uicontrolstate.normal)

c - Displaying the total number of adjacent pairs in this program -

given input char[] find number of discrete pairs in string. input of: "dddd" output 2 pairs "ddd" output 1 pair "dd" output 1 pair "d" output 0 pairs the characters in each pair must adjacent. input of "abca" output still 0 because 'a' s not adjacent. * the goal find total number of pairs in string. input of "aaxbb" output should 2. * for input string of char a[] = "dppccddd" there 3 pairs of adjacent letters my program's output 4 . how solve problem? int = 0, count = 0, count1 = 0; (i = 0; <= 6; i++) { if (a[i] == a[i + 1]) count++; } printf("%d", count); just make code better, instead of hardcoding value of 6, use for(i = 0; < sizeof(a) / sizeof(a[0]) - 1; i++) number of elements in array. the problem code if 2 chars matched, start comparing second 1 again, need skip character, increase i 1: if(a[i] == a[i + 1]) { ++count; ++i; ...

While("abc"); causes an error in java and it does not cause any error in c . Why? -

i tried below code in both java , c++ , throwed error in java while not throw error in c++. why ? while("abc"){ } i know purely depends on property of languages. know why java set condition boolean values should allowed in loops ? i believe talking compiler error , not run-time in case of java while ( expression ) { // expression must evaluate boolean value true or false // far knwo "abc" neither true or false when comes java hence error } in c while ( expression ) { // expression can gives value of either 0 or number // "abc" in case evaluate address positive integer hence no error }

ios - How to implement a double tap gesture on tab bar item -

Image
i developing music app client , need app following image. however when user press middle button once need show full screen player , if user pressed button twice needs show mini audio player. is there way ? if how ? with tabbarcontrollerdelegate can know if selected tab current tab, know can use - (bool)tabbarcontroller:(uitabbarcontroller *)tabbarcontroller shouldselectviewcontroller:(uiviewcontroller *)viewcontroller in method can return no tabbar not switch viewcontroller (if use navigationcontroller tab bar popviewcontorller when duble tap) , can show audio player. this want?

math - How to : Generate bimodal distribuctions -

Image
im working on problem need work bimodal histograms.like on example below. but im getting hard times looking them. im working histograms vector, in exemplo below. there way generate random bimodal histograms programming language? (since can save histograms txt file) histogram 1 8029, 41, 82, 177, 135, 255, 315, 591, 949, 456, 499, 688, 446, 733, 712, 1595, 2633, 3945, 6134, 9755, 9236, 11911, 11888, 9450, 13119, 8819, 5991, 4399, 6745, 2017, 3747, 1777, 2946, 1623, 2151, 454, 3015, 3176, 2211, 1080, 391, 580, 750, histogram 2 8082, 4857, 1494, 2530, 1604, 1636, 1651, 1681, 1630, 1667, 1636, 1649, 1934, 1775, 1701, 1691, 1478, 1649, 1449, 1449, 1503, 1475, 1497, 1398, 1509, 1747 histogram 3 50, 226, 857, 2018, 1810, 1795, 1840, 1929, 1942, 1693, 1699, 1547, 1564, 1556, 1451, 1439, 1448, 1357, 1428, 1419, 1383, 1705, 1670, 1777, 1826, 1865, 1897 . you parameterize unimodal distributions peaks want them, , choose among them desired relative proportions. for i...

bluetooth - android EDR connect timeout -

i need android edr connect. use edr connect device. socket.connect throws exception: read failed, socket might closed or timeout, read ret: -1 then close bluetooth , reopen it. connect return success.

php - charset and issue of special chars -

this question has answer here: utf-8 way through 14 answers i having issues charset , special chars in page : http://goo.gl/uggxwt have added in header section charset code : <html lang="fr"> <meta charset="utf-8"> i tried add in body section header('content-type: text/html; charset=utf-8'); nothing changed still same problem , went htaccess file added adddefaultcharset utf-8 but didn't solved issue can solution situation add well <meta http-equiv="content-type" content="text/html;charset=iso-8859-8">

jquery - zurb foundation bind magellan arrive -

i need bind event once arrival reached. the documentation ( http://foundation.zurb.com/docs/v/3.2.5/magellan.php ) states can access magellan.arrival event, gives no examples on how use it. i have tried it's mot working: $('dd[data-magellan-arrival]').on('arrival',function(){ console.log('arrived'); }) $('dd[data-magellan-arrival]').on('magellan.arrival',function(){ console.log('arrived'); }) i have googled , checked latest documentation can find nothing @ related event.

r - prediction applied to whole data -

hi doing prediction data.if use data.frame throws folloing error. input(bedrooms="2",bathrooms="2",area="1000") specified different types fit here program input <- function(bedrooms,bathrooms,area) { delhi <- read.delim("delhi.tsv", na.strings = "") delhi$lnprice <- log(delhi$price) heddel <- lm(lnprice ~ bedrooms+ area+ bathrooms,data=delhi) valuepred = predict (heddel,data.frame(bedrooms=bedrooms,area=area,bathrooms=bathrooms),na.rm = true) final_prediction = exp(valuepred) final_prediction } if remove data.frame predicts value on data.i got following output. 1 2 3 4 5 6 7 15480952 11657414 10956873 6011639 6531880 9801468 16157549 9 10 11 14 15 16 17 10698786 5596803 14688143 20339651 22012831 16157618 26644246 but needs display 1 value only. any idea ...

java - How do I find the bounds of a Win32 API text/edit control? -

i working on program allow user record steps of simple tasks , generate file send people show these steps. if left click on window "user left clicked on google chrome" appropriate screenshot , highlighted cursor visbility. i using java native hook found here global mouse/key listeners , java native access found here title of application clicked. i include highlights area text entered. @ moment thinking of taking screenshot when user clicks textbox , storing keys pressed (for guide) , taking second screenshot after text has been input, , adding highlight outline around text. i feel easier generate highlighting if location of caret i'm not sure how global applications.

how to add a custom request header in php -

i want send custom header domain. i tried following : header("myheader: value1"); //i want redirect above header samplesite header('location: http://localhost/samplesite', false); exit; and in samplesite, not myheader. how achieve it, please me. you can send custom header file_get_contents() , give context. it this: $data = http_build_query(array("username" => $uid)); $opts = array ( 'http' => array ( 'method' => 'post', 'header'=> "content-type: application/x-www-form-urlencoded\r\n" . "content-length: " . strlen($data) . "\r\n", 'content' => $data ) ); $context = stream_context_create($opts); $returneddata= file_get_contents("example.com", false, $context); remember remote host needs allow kind of requests or error the header() function tried use in example change header send server ...

angularjs directive - What debugging tool to test image load on phone? -

Image
i coding website loading lot of images. i use bootstrap responsiveness, angular , javascript. as can see here : www.carteldelart.com/article/messager, other articles referenced thumbnail image load using directive draw image following code : app.directive("messager", function(){ return function(scope, element){ angular.element(document).ready(function(){ // on récupère l'élément var myurl = "myurl"; var thumbnail_canvas = document.createelement('canvas'); thumbnail_canvas.width = 125; thumbnail_canvas.height = 125; var imagetmp = new image(); imagetmp.crossorigin = "anonymous"; imagetmp.onload = function(){ thumbnail_canvas.getcontext('2d').drawimage(imagetmp, 6, 0, 794, 794, 0, 0, 125, 125); document.getelementbyid("messager").style.backgroundimage = "url("+thumbnail...

video - IOException when playing .mp4 with android mediaplayer -

i trying play .mp4 file in mediaplayer throws ioexception @ mediaplayer.prepare(): 09-21 12:59:33.570 14926-14937/com.alex.videoplayertest e/mediaplayer﹕ error (-2147483648, 0) 09-21 12:59:33.570 14926-14926/com.alex.videoplayertest w/system.err﹕ java.io.ioexception: prepare failed.: status=0x80000000 09-21 12:59:33.570 14926-14926/com.alex.videoplayertest w/system.err﹕ @ android.media.mediaplayer.prepare(native method) 09-21 12:59:33.570 14926-14926/com.alex.videoplayertest w/system.err﹕ @ com.alex.videoplayertest.mainactivity.onresume(mainactivity.java:53) 09-21 12:59:33.570 14926-14926/com.alex.videoplayertest w/system.err﹕ @ android.app.instrumentation.callactivityonresume(instrumentation.java:1185) 09-21 12:59:33.570 14926-14926/com.alex.videoplayertest w/system.err﹕ @ android.app.activity.performresume(activity.java:5182) 09-21 12:59:33.570 14926-14926/com.alex.videoplayertest w/system.err﹕ @ android.app.activitythread.performresumeactivity(activi...

Backported StreamSupport on Java 7/Android -

i mean library: http://sourceforge.net/projects/streamsupport/ it meant compatible java8 streams, tried run examples java8 docs, this: intstream.range(1, 4).foreach(system.out::println); but .range not defined anywhere. library documentation: streamsupport backport of java 8 java.util.function (functional interfaces) , java.util.stream (streams) api users of java 6 or 7 supplemented selected additions java.util.concurrent didn't exist in java 6. but: - can't find single example how use backported library - can see, can't use simplest scenario java8. can give me example how use backported streamsupport, or link documentation? [edit] import java8.util.function.consumer; intstreams.range(1, 4).foreach(new consumer<integer>(){ public void accept(integer next){ system.out.println(next); } }); error message: error:(126, 35) error: method foreach in interface intstream cannot applied given types; required: ...

android - How to populate a spinner based on the first two spinners using setOnItemSelectedListener -

i have 3 spinners, first populated string xml file, second should populated based on selection of first , third 1 based on selection of second. i have search , tried several logic through weekend no success. after setting setonitemselectedlistener on second , third spinners, none of them populated. please me. sample code provided below public class reg_prop extends activity implements adapterview.onitemselectedlistener { //create reference button btnsave; spinner spinprovince, spindistrict, spinlocal; string spinpro, spindist; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_reg_prop); toast.maketext(this, "please select province, district , local municipality " + "property located", toast.length_long).show(); //initialise reference btnsave = (button)findviewbyid(r.id.btnsave); spinprovince = (spinner)findviewbyid(r.id.spinprovince); ...

javascript - Trying to delete Select box using jQuery remove() function -

i trying delete select box using jquery remove function not work. select box dynamically generated one. want delete same select box if user wants delete dropdown after adding. code is: $("#dltelement").click(function() { $("#idselect").remove(); }); my code add select boxes: $(document).ready(function() { var count = 3; $("#btncompare").click(function() { if (count > 4) { alert("only 4 options allowed"); return false; } $("#form-group").append( "<select name='idselect" + count + "' id='idselect" + count + "'>" + "<option>--select product" + counter + "--</option>" + '<option value="p1">product 1</option>' + '<option value="p2">product 2</option>' + ...

Session not retrieved when using Spring RestTemplate or Apache HttpClient -

i have 2 web applications , b(both have http sessions). when try call servlet @ b java class in a, session @ app b not retrieved. tried spring resttemplate , apache httpclient, session coming null. any appreciated. thanks each web application maintains own copy of servletcontext , session objects, in opinion, not able use http sessions across web applications though have deployed them under same server.

javascript - iFrame inside draggable / scrollable area -

i'm stuck @ finding solution problem. let's assume have fixed-sized area scrollbars. need place iframe inside can preview either using scrollbars or dragging it. prevent iframe capturing mouse events, i've put absolute positioned transparent div above it. <div style="" id="scrolling_container"> <div id="drag_div"></div> <div id="frame_div"> <iframe id="page_iframe" src="http://www.bbc.com/" scrolling="auto" frameborder="0"></iframe> </div> </div> then used code transforms mouse dragging div scrolling. var draggablecontainer = document.getelementbyid("drag_div"); var scrollingcontainer = document.getelementbyid("scrolling_container"); draggablecontainer.removeeventlistener('mousedown', draggablecontainer.md, 0); window.removeeventlistener('mouseup', draggablecontainer.mu, 0); ...

How can I stop input using ctrl+d in java and eclipse? -

i stop scanner when pressing ctrl d. possible? import java.util.scanner; public class inputtest { public static void main(string args[]) { scanner input = new scanner(system.in); system.out.print("enter string: "); string string = input.next(); system.out.println(string); /*if(ctrl + d pressed){ scanner.close(); }*/ } }

javascript - Removing innerHTML img element completely -

typebox.innerhtml += "<div class='typebox'><img id='typeimg' width='30px' height='30px' src="+d[o].src+"></div>"; i using innerhtml add multiple images, , need images removed clicking on remove button, can't figure out how this. i have tried: var typebox = document.getelementbyid("typebox"); typebox.style.display = 'none'; using display:none; makes images not show @ all. var typebox = document.getelementbyid("typebox"); typebox.innerhtml = ""; it seems won't remove images, more doing nothing @ all. so how should remove images completely? try this: removechild in case var typebox = document.getelementbyid('typebox'); typebox.innerhtml += "<div class='typebox'><img id='typeimg' width='300px' height='300px' src='https://www.google.co.in/images/branding/googlelogo/2x/googlelog...

logic - Palindromes function in java -

could tell me how write palindromes function in java without using string api's? there inbuilt function in java api you use recursive function if in core logic. here example you. have if beneficial you.

javascript - Keeping the data in a service and displaying it on a view -

i want clean controller , move data fetching logic service, there wouldn't following code in controller: myservice.fetchdata().then(funtion(response) { self.data = response.data; }); this achievement far: link is practice? problems rise this? also how can remove app.users() call in template , leave app.users variable? it practice move logic service, should assign users property (model) instead of relinking service controller: var self = this; this.fetchusers = function() { // assign result 'users' property, can used // in view userservice.fetchusers().then(function(data){ // success self.users = data; // or, because remember users in service: // self.users = userservice.getusers(); }); } and view: <button ng-click="app.fetchusers()">get users</button> <github-table columns="app.columns" rows="app.users"></github-table> edit the service:...

BadMethodCallException in Builder.php: Call to undefined method Laravel 5.0 -

as title says i'm getting error in laravel 5.0 whilst trying upgrade laravel 4.2 application. the exact error message is: call undefined method illuminate\database\query\builder::orders() i error when try fetch authenticated users orders controller following line: $this->user->orders()->orderby('created_at', 'desc')->get() a parent class sets $this->user as: $this->user = auth::user(); the user models relationship orders is: public function orders() { return $this->hasmany('app\models\order'); } to confuse me more $this->user->orders() returns error i'm experiencing user::whereid($this->user->id)->first()->orders() returns orders expecting. when dump both $this->user->orders() , user::whereid($this->user->id)->first()->orders() same output on screen. can explain , possibly point me towards correct way solution feels hacky , i'm sure there cleaner way accomplish ...