Posts

Showing posts from April, 2013

Youtube API v3 - Select menu to access public channel video data without Oauth -

i want access , view public youtube videos (simple read only) youtube channel without resorting oauth, plain api key. haven't found decent layman example on how go api v3 ;-( i have juggle cannot work. basically, select menu contains options values existing channel ids. when option containing channel id selected, should trigger requestuseruploadsplaylistid(). then, when nextbutton or previousbutton activated, function requestvideoplaylist() kick in. there better way this? following error messages in firebug: typeerror: response.result undefined (when choose option selectmenu). typeerror: response.result undefined (after click on buttons). here struggling (am new api v3 , kinda used api v2 (sigh)): <html here> script> $('#nextbutton').prop('disabled', true).addclass('disabled'); </script> <script type="text/javascript" src="https://apis.google.com /js/client.js?onload=onjsclientload"></script> <

javascript - Dynamically updating an ng-include -

this should easy 1 knows angular--i, on other hand, super new it. trying put easy example using ng-include it's not clear why variable inside include not updating. i include html in page (not sure if ng-model necessary): <div ng-model="template" ng-include="template.url"></div> i have button: <a class="btn btn-lg btn-success" ng-model="template" ng-click="switch()" ng-href="#">change!</a> that calls function controller looks this: app.controller('mainctrl', function ($scope) { $scope.templates = [ { name: 'template1', url: 'views/template1.html'}, { name: 'template2', url: 'views/template2.html'} ]; $scope.template = $scope.templates[0]; $scope.switch = function() { $scope.template = $scope.templates[1]; console.log($scope.template); return $scope.template; }; } ); the variable

Django can't get admin static files in Apache server -

This summary is not available. Please click here to view the post.

Using swap to MERGE (append to) a nested map in a Clojure atom? -

let's have atom contains map this: {:count 0 :map hash-map} how can use swap merge key-value pair onto :map ? you'd use assoc-in : (swap! my-atom assoc-in [:map :new-key] value)

vb.net - Making BackgroundImage of PictureBox Nothing -

i'm trying make backgroundimage of picturebox nothing. i've tried backgroundimage3.backgroundimage = nothing backgroundimage3.update() ' didn't work without line of code and dim n0 = image backgroundimage3.backgroundimage = n0 with no success. also, code if statement, if it'll little: if (picturebox3.backgroundimage my.resources.theimageiwant) any suggestions? in visual studio 2010, line works well: backgroundimage3.backgroundimage = nothing after execution of code, background image dissappears; that's trying do? i'm sure problem lies in context you've put backgroundimage change, can post full code. post complete procedure, in have placed code above.

rpmbuild - Create log file when installing rpm -

what best way create log file in rpm spec file? service i'm creating runs under unprivileged user cannot create files in /var/log/. you create /var/log/myservice/ directory , make owned user. inside %install or make install: (ignoring buildroot & such) install -d /var/log/myservice -o serviceuser -m 750 this assumes running service apache runs user apache , still puts logs in var/log/apache then add corresponding rule /var/log/myservice in spec file. %dir /var/log/myservice

ruby - class_eval and open classes -

i using spree, , spree has class called order looks like: module spree class order # class definition. end end in own app, have been customising order so: spree::order.class_eval # customisations end my question is, can this: module spree class order # own customisations. end end any downsides this? essentially, want avoid using class_eval . benjamin, reopen class not inform (but class_eval raise error) if existing class not exist or not loaded. but if have test coverage, reopen class should safe guess?

d3.js - How to efficiently remove first element from a selection? -

i have page displays data using d3.js . due heavy processing load, when page load freezes browser few seconds. i have determined "browser locking" behavior due line of form: selection.attr('d', linefn); ...where selection contains around 10k items. i replace line like function process_rest () { if (selection.size() > 0) { var next_item = first(selection); // function first() hypothetical! next_item.attr('d', linefn); selection = rest(selection); // function rest() hypothetical! settimeout(process_rest, 100); return; } finish_up(); } settimeout(process_rest, 100); i'm looking efficient way implement either first , rest . naive guess like: function first(selection) { return d3.select(selection[0][0]); } function rest(selection) { selection[0] = selection[0].slice(1); return selection; } ...but, afaik, going "behind api", or @ least feels it. there "of

python - Make SQLAlchemy query by list case insensitive -

i'm trying query postgresql database using lists of strings. want return rows column entry matches string , i'd case insensitive finds more things. fruits = ['apple', 'orange', 'pear', 'grape', 'watermelon', 'asian pear'] in case, 'asian pear' can capitalized in database. obs = session.query(datamodel).filter(datamodel.fruitname._in(fruits)).all() i know func.lower() , use individual queries i'm not sure put when using. i'd use func.lower in single item query: obs =session.query(datamodel).filter(func.lower(datamodel.fruitname)==func.lower(fruits[5]))).first() stupid me... in writing question, figured out... answer... session.query(datamodel).filter(func.lower(datamodel.fruitname).in_(fruits)).all()

flash - Box2DFlash ApplyForce() -

i developing new game using box2dflash. write simple code in when click in stage ball move. use applyforce() function accomplish this. problem when ball start move not stop until goes corner of stage. continuously move given velocity. there way decrease velocity of ball per time when moving? code follow - package { import box2d.collision.shapes.b2circleshape; import box2d.collision.shapes.b2polygonshape; import box2d.common.math.b2vec2; import box2d.common.math.b2vec3; import box2d.dynamics.b2body; import box2d.dynamics.b2bodydef; import box2d.dynamics.b2debugdraw; import box2d.dynamics.b2fixturedef; import box2d.dynamics.b2world; import flash.display.movieclip; import flash.display.sprite; import flash.events.event; import flash.events.keyboardevent; import flash.events.mouseevent;

javascript - Is my code right, and is the book I am using wrong? Or am I just losing my mind? -

i using john pollocks "a beginners guide javascript edition 3." the lesson doing 4-2 can found here: http://www.cs.tufts.edu/es/93idi/refs/pollock-3rd.pdf page number pdf 107(actual page number 83/84). correct me if wrong instructions print "hi there!" screen, while giving alert saying "regular text" after printing "this strong text" screen. so following instructions js code named prjs4_2.js in external file should be function two_strings(text1,text2) { var added_text=text1+ " " +text2; return added_text; } function result() { var get_result=two_strings("hi","there!"); document.write(get_result); } var ff_result = two_strings("regular","text"); window.alert(ff_result); result(); then here html code <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="

python - convert Creole to LaTeX -

care recommend tool/workflow(s) converting creole wiki pages/files latex ? i'm grad student has been documenting code , analyses using (a number of) wikis, using creole syntax. creole, i'll need write article, i'll need generate latex. there tool directly , competently? if not, what's next-best, least-effort, highest-quality indirect path? things came mind are: pandoc : supports latex both input or output, not support creole either input or output. (am missing something?) restructuredtext : know pandoc supports rest both input or output, , of course it's used python, i'm starting use rest new wikis. i'm not seeing creole -> rest converter . (am missing something?) html: pandoc supports html both input , output, i'm sure zillion other tools, including python-creole . creole >python-creole> html >pandoc> latex seems feasible (am missing something?) indirect. pandoc offers creole2latex interface can tested online . creo

Android Robotium- Error testing listview -

hi there have simple listview wish test row of each listview represented in xml file below <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <textview android:id="@+id/id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="16sp" android:textcolor="#f87217" android:textstyle="bold" /> <textview android:id="@+id/cluster" android:layout_width="wrap_content" android:l

adding character values in java -

import java.awt.*; //container, gridlayout, *, or etc... import javax.swing.*; //jframe, jlabel, *, or etc... import java.awt.event.*; public class numerologyec extends jframe { private static final int width = 400; private static final int height = 200; private jlabel wordjl, sumjl; private jtextfield wordtf, sumtf; private jbutton calculatejb, exitjb; private calculatebuttonhandler cbhandler; private exitbuttonhandler ebhandler; public numerologyec() { settitle ("numerology credit"); wordjl = new jlabel ("enter word: ", swingconstants.right); sumjl = new jlabel ("sum of letters: ", swingconstants.right); wordtf = new jtextfield(10); sumtf = new jtextfield(10); calculatejb = new jbutton ("calculate"); cbhandler = new calculatebuttonhandler(); calculatejb.addactionlistener (cbhandler); exitjb = new jbutton ("exit"); ebha

javascript - Add custom symbols to google Maps -

i doing project based on google maps. need simulate path subjects have traveled. idea how that? fyi application functionality similar flightradar24.com when creating google.maps.marker object in javascript can specify specific image used in place of pin icon property. simulate path can erase , redraw pins. recommend saving pins array can reference later update , redraw pins. https://developers.google.com/maps/documentation/javascript/reference#markeroptions ex: var marker = new google.maps.marker({ position: location, map: map, icon: pintype });

How to remove part of the string from one character to another in php -

i have url string http://mydomain.com/status/statuspages/state/stack:3/my_link_id:1#state-9 i want remove my_link_id:1 string. know can use string replace function $goodurl = str_replace('my_link_id:1', '', $badurl); but problem is, integer part dynamic. mean in my_link_id:1 1 dynamic. id of link , can 0 number . want remove my_link_id:along dynamic number string . what think should remove part of string last / # . how can that? you can use regular expressions: $goodurl = preg_replace('/(my_link_id:[0-9]+)/ig', '', $badurl);

excel - Dynamic Range for Intentionally Showing Nothing -

so, i've created dynamic range chart, that's , easy. however, in chart there 2 lines, want 1 of lines show under conditions, else displays nothing! i've tried creating dynamic range follows =if('worksheetname'!$m$10 ='worksheetname'!$f$31,'worksheetname'!dynamic_range, #n/a) the problem when chart freaks out. gives me error: your formula contains invalid external reference worksheet. verify path, workbook, , range name or cell reference correct, , try again. if click "ok" half time shows correctly (that is, second line disappears , chart adjusts accordingly) , other half time glitches. basically, how create dynamic range graphing chart understand when want nothing , when want display range? you need second source range, that's cells empty. applying approach switch between filled range (intended visible) vs. empty range (will invisible), shall solve issue. note: chart parameter "show empty cells as:&

angularjs - Angular ng-init pass element to scope -

is there way current element ng-init binded on? for example: <div ng-init="dosomething($element)"></div> i believe there way ng-click can't using ng-init this: <div ng-click="dosomething($event)"></div> controller: $scope.dosomething = function(e){ var element = angular.element(e.srcelement); } how do ng-init? don't it. as @codehater said, handling dom manipulation in directive better solution engaging controller element.

html - How to add "id" attribute in form element using MVC4 -

i tried add id attribute in form element using following code: @using(html.beginform("<action>", "<controller>", new {id="search"})) i got following code in source view: <form action='/controller/action/search' method="post"> i need add "id" attribute. how that? thanks in advance try @using(html.beginform("<action>", "<controller>",formmethod.post, new {id="search"}))

Easy Dialog box in ruby -

i developing minor ruby script windows , need suggestions. this script interact on user's input , ui need small dialog box 3 options -> option 1 , option 2 or cancel. depending on user clicks run further methods. there easy way achieve this. have looked lot of ruby gems fxruby, shoes me achieve there easier way create easy vb script , response code on user clicked? don't want use gem small pop dialog box. thanks advice

sql - Why the below join query returns different result? -

1st query - select * full outer join b on a.x = b.y b.y = 10 2nd query - select * full outer join b on a.x = b.y , b.y = 10 consider these table extensions: table table b ======= ======= x y ----- ----- 1 2 5 5 10 10 the first query return: 10 10 and, second query return: 1 null 5 null 10 10 could please let me know reasons in detail ? the first query gives expected result. but second query's result different because joining tables on both conditions (a.x = b.y , b.y = 10) . , since outer join, it'll print values satisfy , null , output. created sql fiddle can understand better

ffmpeg segment to devide video into small chunks -

hello want split video small chunks.i using ffmpeg segment achieve , want split video in same video lenght chunks.i using ffmpeg segment split video.i have written command **ffmpeg -i first.mp4 -codec copy -map 0 -f segment -segment_time 10 -segment_list out.list splitvideo/out%04d.mp4** when executing command splits video in small chunks not accurate.the chunks not of same length from personal experience realized following: depending on video format, there dependencies between different frames. means frames depended on other frames decoded. therefore splitting maybe cannot done @ time want because of these dependencies might lost connections , hence cannot decoded later. ffmpeg find nearest point independent previous frames dependencies satisfied. cause different lengths.

python - Equivalent of Series.map for DataFrame? -

using series.map series argument, can take elements of series , use them indices series. want same thing columns of dataframe, using each row set of index levels multiindex-ed series. here example: >>> d = pandas.dataframe([["a", 1], ["b", 2], ["c", 3]], columns=["x", "y"]) >>> d x y 0 1 1 b 2 2 c 3 [3 rows x 2 columns] >>> s = pandas.series(np.arange(9), index=pandas.multiindex.from_product([["a", "b", "c"], [1, 2, 3]])) >>> s 1 0 2 1 3 2 b 1 3 2 4 3 5 c 1 6 2 7 3 8 dtype: int32 what able d.map(s) , each row of d should taken tuple use index multiindex of s . is, want same result this: >>> s.ix[[("a", 1), ("b", 2), ("c", 3)]] 1 0 b 2 4 c 3 8 dtype: int32 however, dataframe, unlike series, has no map method. other obvious alternative, s.ix[d] ,

php - Codeigniter: Validate form field on edit -

i having trouble , since more week trying find solution disallow duplicate form content if exists in database. so check rows excluding id (row) editing , if same value exists should give error message. here code. position controller public function position_edit($id = null) { $this->data['title'] = '<i class="fa fa-user"></i> ' . lang('position_edit'); $this->data['position'] = $this->positions_model->get($id); count($this->data['position']) || $this->data['errors'][] = 'position not found'; $id = $this->uri->segment(4); $this->db->where('position', $this->input->post('position')); !$id || $this->db->where('id !=', $id); $pos = $this->positions_model->get(); echo '<pre>', print_r($pos), '</pre>'; if (count($pos) > 0) { $this->form_validation->

actionscript 3 - Adobe Flash Builder -

is there way can adopted, create cross platform responsive mobile apps using flash builder ? we using our custom written resigning engine purpose right now, tend replace generic resigning tool or cater responsiveness kind of devices/platforms. being on same cross platform development, i.e. flex, action script , mxml, there solution this? thanks it's possible deploy flex-apps on mobile devices, see mobile app development @ adobe devnet more details

Android Parse Push notification device registration only one time on one device -

every 1 using parse service push notification in app. register time when re-install app in 1 device.then problem that,one device receive multiple notifications on each. have done code registration shown below. please me,thanks in advance. parse.initialize(this, parse_app_id, parse_client_key); parseacl defaultacl = new parseacl(); defaultacl.setpublicreadaccess(true); parseacl.setdefaultacl(defaultacl, true); pushservice.setdefaultpushcallback(this, mainactivity.class); parseinstallation.getcurrentinstallation().getinstallationid(); parseinstallation.getcurrentinstallation().saveinbackground(); and subscribe: pushservice.subscribe(this, username, detail.class); in manifest above <permission android:name="com.example.app.permission.c2d_message" android:protectionlevel="signature" /> <uses-permission android:name="com.example.app.permission.c2d_message" /> in application tag: <receiver android:name="c

Multithreading in c# - Replicate Console class behaviour -

i have application executed 4 function sequentially. inside each function have outputs logged using console.writeline . console internally made redirect data file. i have change working 4 functions can run in parallel. else being fine concern output logging in file. console.writeline write data in file in random order don't want. want threads finish , log output data in sequence want. so how capture output inside each thread? in string , console.writeline 4 string make? capture data in file each thread , console.writeline when thread finish . some other class console data read/written in same way console class? i want output same how earlier when application running function sequentially. if know of output fit in memory, can write output strings , append strings file when done. there many ways output string. purposes, perhaps easiest create stringwriter each thread. example: stringwriter output = new stringwriter(); then, replace of console.writ

c# - Calculated field in model class gives exception -

i'm getting exception when executing linq query: the specified type member 'active' not supported in linq entities. initializers, entity members, , entity navigation properties supported. model class public class user : entity { //many properties skipped [notmapped] public bool active { { return orders.any(c => c.active && (c.transactiontype == transactiontype.order || c.transactiontype == transactiontype.subscription)); } } } the linq query gives exception public ienumerable<user> getinactiveusersforsuspensionnotification() { return _userrepository.getall() .include(i=>i.orders) .where(w => w.active == false); } orders related table users . when using linq entities linq expression converted sql query sent database. whole table not pulled memory. your problem becaus

c++ - Cannot construct object -

i spend last 2 hours trying figure out why following code won't compile , got nothing. relevant parts of code follows (full code here http://pastebin.com/z78iy3aa (hpp) , http://pastebin.com/5mc6twet (cpp) here if needed): /* file: du1simd.hpp */ #include <iterator> #include <cstdint> #include <new> template< typename t, typename s> class simd_vector; template<typename t, typename s> class simd_vector_iterator : public std::iterator<std::random_access_iterator_tag, t> { typedef typename simd_vector<t, s>::iterator self_type; typedef typename std::iterator<std::random_access_iterator_tag, t>::pointer pointer; typedef typename std::iterator<std::random_access_iterator_tag, t>::reference reference; typedef typename std::iterator<std::random_access_iterator_tag, t>::value_type value_type; typedef typename std:

javascript - How to resubmit form? -

i want when resubmit form goes next page. but, when trying resubmit form recursively called '$('#payment-form').submit(function(e){}' function , program goes in infinite loop. try, $form.get(0).submit(); i don't know code not working. what change can code work properly.please suggest me find out solution. code: <script type="text/javascript"> // identifies website in createtoken call below stripe.setpublishablekey('pk_test_jvzbqne7ydpeizomqo0d9mar'); var striperesponsehandler = function( status , response) { var $form = $('#payment-form'); if (response.error) { // show errors on form alert("error...!"); var error = " error : "+response.error.message; $form.find('.payment-errors').text(error); $form.find('button').prop('disabled', false); return false; } else

mysql - How to set variable by select? -

in mssql, can use: select @desc_out=desc01 , @flag_out=flag a01 id=@id_in to set variable. but in mysql, possible set variable using select ? this mssql code: create table [dbo].[a01]( [id] [varchar](4) null, [desc01] [varchar](20) null, [flag] [varchar](1) null ) on [primary] if (select object_id('p_a01')) not null drop proc p_a01; create proc p_a01 @id_in varchar(4),@desc_out varchar(20) output,@flag_out varchar(1) output begin select @desc_out=desc01,@flag_out=flag a01 id=@id_in end; declare @desc_out varchar(20); declare @flag_out varchar(1); exec p_a01 'a001',@desc_out output,@flag_out output; select @desc_out, @flag_out; please suggest me same using mysql. try this: select @desc_out:=desc01,@flag_out:=flag a01 id=@id_in ie setting variable in select in mysql need use := instead of = also better if can declare variables before using them in select .

Can not access a function in Magento? -

how can access function drawcustommenublock() in file eternal\custommenu\eternal\custommenu\block\catalog\navigation.php, wants access these function in page app\design\frontend\zonda\default\template\page\html\header.phtml. if place these code in file <?php echo $this->drawcustommenublock() ?> then shows error : exception printing disabled default security reasons. how can solve ? please me out of this. new in magento. thanks in advance. inside phtml file, $this means instance of block. example: page\html\header.phtml, $this instance of app/code/core/mage/page/block/html/header.php . so create method called " drawcustommenublock " inside app/code/core/mage/page/block/html/header.php , call page\html\header.phtml . try it.

jquery - IE8 background image is not showing correctly -

i used http://css3pie.com/ while creating button ie8 here code .mybutton { -webkit-border-radius: 8px; -moz-border-radius: 8px; border-radius: 8px; background: #135496; background: url("../img/arrow_white.png"),-webkit-gradient(linear, 0 0, 0 bottom, from(#135496), to(#12408d))no-repeat !important; background: url("../img/arrow_white.png"),-webkit-linear-gradient(#135496, #12408d)no-repeat !important; background: url("../img/arrow_white.png"),-moz-linear-gradient(#135496, #12408d)no-repeat !important; background: url("../img/arrow_white.png"), -ms-linear-gradient(#135496, #12408d)no-repeat !important; background: url("../img/arrow_white.png"),-o-linear-gradient(#135496, #12408d)no-repeat !important; background: url("../img/arrow_white.png"), linear-gradient(#135496, #12408d)no-repeat !important; -pie-background: url("../img/arrow_white.png"), linear-gradient(#1354

apache2 - Set up apache reverse proxy for different apps in tomcat -

i have 2 apps in tomcat. set reverse proxy 1 of them. app folder test . problem when hit url app, /test added url. below configuration file reverse proxy in sites-available folder: test.eunice.lan <virtualhost *:80> serveradmin webmaster@localhost servername test.eunice.lan proxypreservehost on proxyrequests off proxypass / http://localhost:8080/test/ proxypassreverse / http://localhost:8080/test/ </virtualhost> your proxypass configuration going lead mass confusion because url prefix not same context path. better: proxypass /test/ http://localhost:8080/test/ if don't want add /test beginning of url, should re-name test.war root.war (or exploded-war directory test/ -> root/ ) (case-sensitive, on case-insensitive filesystems). if have two webapps you'll want separate them url prefix (e.g. /test , /dev otherwise end jsessionid cookie-confusion, assuming using cookie-based sessions in both web appli

c++ - Logically extending file fails -

the following code fails when trying logically extend windows 8.1 file setfilevailddata() . the returned windows error code , message is: error_privilege_not_held 1314 (0x522) required privilege not held client. i'm running code administrator , have asserted process indeed has se_manage_volume_name privilege using openprocesstoken() , gettokeninformation() . // setfilevaliddata_test.cpp : defines entry point console application. // #include "stdafx.h" #include <iostream> #include <windows.h> bool processhassemanagevolumeprivilege(); int _tmain(int argc, _tchar* argv[]) { // set access methods dword accessmethods = generic_read | generic_write; // set share modes dword sharemodes = 0; // set security attributes lpsecurity_attributes secattr = null; // set creation disposition dword creationdispositions = create_always; // set file flags dword fileflags = 0; // set template handle t

sql - Export large data to CSV using PHP -

i trying export data csv using php. my code: function download_send_headers($filename) { // disable caching $now = gmdate("d, d m y h:i:s"); header("expires: tue, 03 jul 2001 06:00:00 gmt"); header("cache-control: max-age=0, no-cache, must-revalidate, proxy-revalidate"); header("last-modified: {$now} gmt"); // force download header("content-type: application/force-download"); header("content-type: application/octet-stream"); header("content-type: application/download"); // disposition / encoding on response body header("content-disposition: attachment;filename={$filename}"); header("content-transfer-encoding: binary"); } $giventerm = $_post['textboxlist']; $sql_query = "select * some_table key=".$giventerm; $result = sqlsrv_query($conn,$sql_query); $r1 = array(); $file = fopen("php://output", 'w'); wh

c# - Get subitem value in radlistview items -

here listview <telerik:radlistview runat="server" id="lvallusers" width="30px"> <itemtemplate> <table> <tr> <td > <asp:checkboxlist id="cbid" runat="server" cssclass="item" font-size="15px" repeatdirection="horizontal"> <asp:listitem text=" " > </asp:listitem> </asp:checkboxlist></td> <td style="padding-bottom:10px"><%# eval("firstname") %></td> <td style="padding-bottom:10px"><%# eval("familyname") %></td> </tr> </table> </itemtemplate> </telerik:radlistview> how can checkboxlists item text @ code behind ? or how can firstname , familyname , code behind after binded data @ pageload? can't use foreach (telerik.web.ui.radlistviewite

sql statement that gives me entities that contanins 1.value AND 2.value from one column -

i table looks this: column1|column2 1 |a 1 |b 1 |c 2 |a 3 |b 4 |a 4 |b ... what need write sql statetment entities column1 has values , b in column2. in case result be: 1,4 thx in advance help. try this select column1 your_table group column1 having max(case when column2='a' 1 else 0 end)+ max(case when column2='b' 1 else 0 end)=2

jquery - How to call a WebService using backbonejs -

i new backbonejs, , want call this webservice. will me how call service using backbonejs. try one. put code render function formdata = { north: "44.1", south: "-9.9", east: "-22.4", west: "55.2", lang: "de", username: "demo" } $.ajax({ type: 'get', contenttype: 'application/json', url: "http://api.geonames.org/citiesjson", datatype: "json", data: formdata, success: function(data) { console.log(data); //success handler }, error: function(data) { //error handler } }); this.$el.html(yourviewtemplate);

android - Always Open Navigation-Drawer on Tablet -

i want keep navigation-drawer open in tablets. using following code when ever touch content frame getting null pointer exception. my xml file: <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v4.widget.drawerlayout android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- navigation drawer --> <listview android:id="@+id/left_drawer" android:layout_width="@dimen/drawer_size" android:layout_height="match_parent" android:layout_gravity="start" android:choicemode="singlechoice" android:divider="@android:color/transparent" android:dividerheight="0dp" android:background="#111"/&