Posts

Showing posts from September, 2012

Best and worst case running time of an algorithm -

i need calculate best , worst case running time of following algorithm. matter need consider i*i in second loop? , complexity of loop q(n^2) ? i=1 2*n j=1 i*i k=1 k<j if j%i==0 sum=sum+1; this full code procedure proc(n:integer){ var i,j,k :integer var sum: integer begin sum=0; i=1 2*n begin j=1 i*i begin k=1 k<j begin if j%i==0 sum=sum+1; end if k=k+1; end j=j+1; end i=i+i; end end } let's analyze inside out. if j%i==0 sum=sum+1; this takes constant time every time reached. k=1 k<j the inner loop runs o(j) times, once each value of k 1 j (exclusive). far have o(j*1) = o(j) j=1 i*i for middle loop - each value of j has job in complexity of o(j) . means, going need entire loop (for each value of i

commit - How to get (only) author name or email in git given SHA1? -

i check author's e-mail , name, surname verify who's pushing repo. is there way can come command in git show commiter's name/e-mail given sha1 of commit? this came it's far ideal solution (the first solution git hook that's why it's using 2 sha1s rev-list . second 1 uses git show ): git rev-list -n 1 --pretty=short ccd3970..6ddf170 | grep author | cut -d ' ' -f2- | rev | cut -d ' ' -f2- | rev git show 6ddf170 | grep author | cut -d ' ' -f2- | rev | cut -d ' ' -f2- | rev you can use following command: git log --format='%ae' hash^! it suppose work git show well, reason doesn't me when tried it. git show --format='%ae' hash

android - Dismiss non-application Window when Home button pressed -

i have non-application window (i.e. window no activity context, appears on other apps). window technically view has been added using windowmanager.addview() , type_system_error . i remove window when home button pressed seems impossible intercept home button press. is there way this? edit: app not have activity cannot use methods on activity class. you can detect when user press home button with: http://developer.android.com/reference/android/app/activity.html#onuserleavehint() but can't override system behaviour action.

Responsive Telerik RadHtmlChart -

i using telerik radhtml chart need chart should auto size based on screen resolution how it. have tried set width , height auto not working. chart containing in datalist code block below <asp:updatepanel id="pnlcontainer" runat="server" updatemode="conditional"> <contenttemplate> <div id="wrapper"> <asp:datalist id="dtlstdashboards" runat="server" repeatcolumns="2" repeatdirection="horizontal" onitemdatabound="dtlstdashboards_itemdatabound" width="100%" datakeyfield="dashboardid"> <itemtemplate> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td align="left&qu

java - Behavior of entrySet().removeIf in ConcurrentHashMap -

i use concurrenthashmap let 1 thread delete items map periodically , other threads put , items map @ same time. i'm using map.entryset().removeif(lambda) in removing thread. i'm wondering assumptions can make behavior. can see removeif method uses iterator go through elements in map, check given condition , remove them if needed using iterator.remove() . documentation gives info concurrenthashmap iterators behavior: similarly, iterators, spliterators , enumerations return elements reflecting state of hash table @ point @ or since creation of iterator/enumeration. hey not throw concurrentmodificationexception. however, iterators designed used 1 thread @ time. as whole removeif call happens in 1 thread can sure iterator not used more 1 thread @ time. still i'm wondering if course of events described below possible: map contains mapping: 'a'->0 deleting thread starts executing map.entryset().removeif(entry->entry.getvalue()==0) delet

javascript - React / JSX Dynamic Component Name -

i trying dynamically render components based on type. for example: var type = "example"; var componentname = type + "component"; return <componentname />; // returns <examplecomponent /> instead of <examplecomponent /> i tried solution proposed here react/jsx dynamic component names that gave me error when compiling (using browserify gulp). expected xml using array syntax. i solve creating method every component: newexamplecomponent() { return <examplecomponent />; } newcomponent(type) { return this["new" + type + "component"](); } but mean new method every component create. there must more elegant solution problem. i open suggestions. <mycomponent /> compiles react.createelement(mycomponent, {}) , expects string (html tag) or function (reactclass) first parameter. you store component class in variable name starts uppercase letter. see html tags vs react components . var m

java - How to set Adapter for listview with image in Android -

i have click button show listview image. unfortunately, application stops when click on button. have set custom adapter still same. here code: public class r1 extends activity { string[] signtitle; string[] signdescription; int images[]={r.drawable.a,r.drawable.b,r.drawable.c,r.drawable.d,r.drawable.e,r.drawable. f,r.drawable.g,r.drawable.h}; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.r1); resources res = getresources(); signtitle = res.getstringarray(r.array.titile); signdescription = res.getstringarray(r.array.description); listview lv = (listview) findviewbyid(r.id.listview); customlistadapter adapter = new customlistadapter(this,signtitle,images,signdescription); lv.setadapter(adapter);} customadpater.java public class customlistadapter extends arrayadapter<string> { context c

android - navigation drawer does not show main layout when app start -

my navigation drawer works perfect every time run program drawer opened default instead of main layout. navigation drawer should opened when clicked on drawer button. public class mainactivity extends activity { private drawerlayout mdrawerlayout; private listview mdrawerlist; private actionbardrawertoggle mdrawertoggle; private charsequence mdrawertitle; private charsequence mtitle; customdraweradapter adapter; list<draweritem> datalist; @suppresslint("newapi") @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // initializing datalist = new arraylist<draweritem>(); mtitle = mdrawertitle = gettitle(); mdrawerlayout = (drawerlayout) findviewbyid(r.id.drawer_layout); mdrawerlist = (listview) findviewbyid(r.id.left_drawer); mdrawerlayout.setdrawersha

android - how to apply animation on dynamic crated table layout? -

i want apply couple of animation effects, adding rows on scroll , deleting rows on scroll down in tablelayout. does have idea on how can implement that? i've found implementation of jazzy list view https://github.com/twotoasters/jazzylistview

Redshift - truncating string when inserting to target -

i have 2 tables. table operational store , table b destination table. table ddl: column varchar(1000) table b ddl: column b varchar(250) so i'm trying insert of truncated column so: insert table b (select left(table a.column a, 249)) , gives error "error: value long character type" i have tried substring try , truncate text no avail. please note, there arabic text in column - hasn't been issue in table a. any / suggestions appreciated! to around issue of multi-byte characters, can cast field desired varchar size using ::varchar([some length]). example, do: insert table b (select table a.column a::varchar(250))

inheritance - Using Inheritence efficiently in C++ -

below code have written in inserting node simple binary search tree. trying implement red black tree inheriting same node class rbnode class. void node::insert_node(tree *t) { node *cur_node = t->get_root(); node *prev_node; while(null != cur_node) { prev_node = cur_node; if(this->data < cur_node->data) { cur_node = cur_node->left; } else { cur_node = cur_node->right; } } if(null == t->get_root()) { cur_node = this; t->set_root(cur_node); } else { if(this->data < prev_node->data) { prev_node->left = this; } else { prev_node->right = this; } this->parent = prev_node; } } this function remain same rbnode, except node* should replaced rbnode* , tree* replaced rbtree*. think it's futile write same function in rbnode c

osx - Xcode project file size is rather large -

ok, close submitting wwdc scholarship app, have noticed file size xcode project 130mb. limit 100mb. when click 'get info' on project folder in 'developer' folder, tells me it's 130mb, if go folder , check 3 folders sizes, 1 53mb , other 2 tiny... why telling me it's 130mb overall? also, i've checked again , without changing anything, it's gone 132mb?! anyone know what's going on? if app using video files displayed user, can place them in server , download on request , cache them. 1 of our project have followed approach , tried save space.

entity framework - Updating database table & column -

using mvc4 , ef code first i renamed table/column-name i.e. table: categories category in model , in code , when run migration statement update-database -verbose -force i error: the create unique index statement terminated because duplicate key found object name 'dbo.categories' , index name 'pk_dbo.categories'. duplicate key value (). not create constraint. see previous errors. statement has been terminated. in configuration file have automaticmigrationsenabled = true; is there else need make changes apply in database? you cannot modify pk. 1 - delete existing database run update-database 2 - generate update script running update-database -script , add drop index tsql generated file , run script. 3 - remove key constrain table via visual studio or management studio remove tsql dropping index in generated script run script.

java - Stream multiple files over HttpUrlConnection -

my application need transfer multiple files http server (by opening outputstream httpurlconnection) avoid overhead of connection establishment use 1 connection only. feasible? note: data created in real time cannot add them 1 archive file , transfer 1 shot. thanks advices! you're over-optimizing. httpurlconnection tcp connection pooling behind scenes. use new url, httpurlconnection , outputstream , etc., per file.

xcode - Using arg[v] as int? - Objective C -

i'm trying pass arguments , integer variable @ start of program in xcode using objective c. far methods i've found have given me variety of error messages or crashed vm. int numcols, numrows; int main(int argc, const char * argv[]) { @autoreleasepool { if (argc != 3){ nslog(@"%2s", "wrong number of arguments"); exit(1); } //numrows = (int)(argv[1] - '0'); //numcols = (int)(argv[2] - '0'); these lines cause crash numrows = 3; numcols = 4; i want numrows take first argument , numcols take second. went settings in xcode change starting arguments 3 , 4, if check them or print them come out random numbers. first of question not clear, how understand can say. argc means argument count , argv means argument value. if want cast char int. try this [[nsstring stringwithformat:@"%s", argv[2]] intvalue];

media player - Android MediaPlayer seekTo() function working incorrect -

i have problem when using mediaplayer play video url. the follow of program : create activity play video -> press home button -> app. the requirement video play start, when press home button video continuos play(only audio), , when app, video must play continuous(combine movie , audio). the first, created mediaplayer variable play video. when home button pressed, mediaplayer play continuous. when app, video cannot displayed(black screen). so, created other mediaplayer variable solved issue. when using seekto() function seek second mediaplayer position of first mediaplayer , function working incorrect. import java.io.ioexception; import com.example.videotest.r; import android.app.activity; import android.media.audiomanager; import android.media.mediaplayer; import android.media.mediaplayer.onbufferingupdatelistener; import android.media.mediaplayer.oncompletionlistener; import android.media.mediaplayer.onpreparedlistener; import android.media.mediaplayer.onseekco

c++ cli - How to find given content of node and modify xml file using C++/CLI -

loginsandpasswords.xml looks this: <?xml version="1.0" encoding="windows-1250"?> <allusers> <user> <id>2</id> <login>a</login> <password>a</password> </user> <user> <id>5</id> <login>b</login> <password>b</password> </user> <user> <id>7</id> <login>c</login> <password>c</password> </user> </allusers> at first insert login name loginbox . before add new user want check if login exists in xml file. example check if login named loginbox->text=b exists in xml file. if yes want show messagebox("given login exists choose another") . if no want create new user in xml file given unique login( loginbox->text ), given password( passwordbox->text ) , id greater max id value of users. this should help: private: system::void button1

xampp - Restoring a wiki website from a SQLite backup -

a portable wiki had setup physically damaged in flashdrive resided in. thankfully, made backups of files found in "g:\xampp\htdocs\wiki\cache". i'm having difficulty restoring use in new wiki. i set things using tutorial , haven't made changes exception of minor wiki extensions. http://lifehacker.com/354005/run-your-personal-wikipedia-from-a-usb-stick i found , backed 2 files in 'cache' folder prior this. .htaccess (which i'm assuming can replaced) [1 kb] wikiname.sqlite (is hope pages stored) [7,863 kb] i sincerely hope second contains of old wiki's content. able read of opening file .txt editor. unfortunately, .sqlite file unreadable via program. to read data sqlite database should use sqlite browser; google you find one. so, in case database complete , not damaged, should able restore wiki. first: make copy of backup, if went wrong :) after it, setup new wiki latest stable version (btw: version did used wiki?), @ moment

orchardcms - Using Orchard CMS with existing ASP.Net Membership Provider -

my company thinking use orchard cms framework our intranet application. speaking theoretically, should work; however, i'm facing troubles finding information using existing setup. have database, old application, have our accounts, logins, etc. based on asp.net memebership provider, , have our own custom authorisation, roles, etc. can guides me direction find information how "plug" orchard cms existing asp.net memebership provider, , apply custom authorisation logic? basicaly need override orchard's imembershipprovider . have @ answer , @ piotr's blog post blog post

python - Resampling in scikit-learn and/or pandas -

is there built in function in either pandas or scikit-learn resampling according specified strategy? want resample data based on categorical variable. for example, if data has 75% men , 25% women, i'd train model on 50% men , 50% women. (i'd able generalize cases aren't 50/50) what need resamples data according specified proportions. stratified sampling means class distribution preserved. if looking this, can still use stratifiedkfold , stratifiedshufflesplit , long have categorical variable want ensure have same distribution in each fold. use variable instead of target variable. example if have categorical variable in column i , skf = cross_validation.stratifiedkfold(x[:,i]) however if understand correctly, want resample target distribution (e.g. 50/50) of 1 of categorical features. guess have come own method such sample (split dataset variable value, take same number of random samples each split). if main motivation balance training set classifier,

rest - How To Define API Blueprint X-Auth-Token Header -

i have number of services require x-auth-token header sent similar below: x-auth-token: 2e5db4a3-c80f-4cfe-ad35-7e781928f7a2 i able specify in api documentation following api blueprint standard. however, can tell api blueprint headers section definition , can specify literal values (e.g. accept-charset: utf-8 ) , not schema header should (e.g. x-auth-token (string) ). i impression traits might problem it's little on head @ moment. can tell me how specify requests given action (or set of actions) require x-auth-token header? you right not being able define schema headers. unfortunately, api blueprint doesn't support yet. until supported, can use literal value header following: + headers x-auth-token: 2e5db4a3-c80f-4cfe-ad35-7e781928f7a2 api blueprint not support traits currently. afraid might have been confused reading other feature requests.

html - How deploy these on my raspberry pi running Apache? -

i transfer pdf file html online , got file downloaded, contains 4 files: xxxxx.htm , image.jpg , xxxxx.pdf , , folder called xxxxx_images contains picture called xxxxx1*1.jpg . if put html raspberry, pdf picture doesn't show up. should put image in? website store in /var/www/index.html . here code <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="x-ua-compatible" content="ie=8"> <title>created bcl easyconverter sdk 3 (html version)</title> <style type="text/css"> body { margin-top: 0px; margin-left: 0px; } #page_1 { position:relative; overflow: hidden; margin: 130

javascript - Check to see if a button is clicked on... not working -

just brief explanation of part of code does: i have 2 buttons different things. one of them lets user search through table/database whatever he/she wants search for the other lets user insert things database what i'm trying do: i'm trying check see button user clicked on appropriate code executed. i've been looking around , pretty everywhere go, people suggesting use isset(), it's not working me. perhaps don't understand isset() does, doesn't check see whether variable set? here's code: <script> function show(x, y){ <!-- --> } </script> <form> <button name = "sbutton" type = "button" onclick = 'show("searchform", "insertform");'>perform search</button> <button name = "ibutton" type = "button" onclick = 'show("insertform", "searchform");'>insert data&

windows - Syncing OneDrive (SkyDrive) with Batch File (via cmd) -

Image
basically, i'm wondering if it's possible sync onedrive batch file. see, can sync whenever go file explorer, right click on "onedrive" on left, , click "sync," i'm wondering if there's command windows has incorporated have exact same effect when used batch file. have no idea , have searched no avail, hope can me! whatever takes, i'm sure extremely simple script; problem finding out command use. here's example picture: get onedrivesync.bat , test it.be minded work if machine language english.the sync third verb if inactive third pause cant create language independent version @ moment.

How to create a typeclass instance for any subclass of Traversable in Scala -

i've created toy example illustrate compiler error don't understand. shouldn't implicit conversion c[_] <: traversable[t] safe[t] safe[c[t]] apply? import scala.language.{implicitconversions, higherkinds} class toyexample { implicit val stringsafe = new safe[string] { override def stringify(value: string): string = value } def main(args: array[string]): unit = { val a: string = "c" val b: seq[string] = seq("1", "2", "3") safe(a) safe(b) // why compiler error? } def safe[t](value: t)(implicit safe: safe[t]): string = safe stringify value } object safe { implicit def safetraversable[c[_] <: traversable[t], t](implicit safe: safe[t]): safe[c[t]] = new safe[c[t]] { override def stringify(value: c[t]): string = value.map(safe.stringify).tostring() } } trait safe[t] { def stringify(value: t): string } ok, figured out how code compile, don't understand reaso

Rotate image by x degrees? - Java -

this question has answer here: java: rotating images 3 answers all right, attempting create simple-ish game , have galaxy swirly id rotate, thing though, unsure how, if use graphics2d "g.rotate(x)" on screen had drawn spins want galaxy rotate , not words , stuff. background class: package tilemap; import java.awt.graphics; import java.awt.graphics2d; import java.awt.image.bufferedimage; import javax.imageio.imageio; public class background { private bufferedimage image; private int x; private int y; private int dx; private int dy; public background(string imglctn){ try{ image = imageio.read(getclass().getresourceasstream(imglctn)); } catch(exception e){ e.printstacktrace(); } } public void draw(graphics2d g){ g.drawimage(image, x - 44, y - 33, null

visual studio - search the database and put it in textbox -

using vb 6 , adodb connection, when click search id, inputbox appear, when finds id wanted, automatically insert data of row corresponding textboxes. here code, @ somepoint, not work, dont remember error post here when home, guys. private sub cmdsearch_click() findemployee = inputbox("insert employee id") record.open ("select * employees id='" & findemployee & "'"), conn, 3, 3 if record.eof msgbox "no" & findemployee & " id not found!", vbcritical + vbokonly, "error search" set record = nothing else txtemployeeid.text = record!id txtlnames.text = record!lastname txtfnames.text = record!firstname txtmnames.text = record!middlename cmbgenders.text = record!gender bdates.value = record!birthdate txtbplaces = record!birthplace txtages = record!age txtaddress.text = record!address cmbeduc

python 2.7 - "get_paginated_response" in django-rest-framework 3.0 -

in drf 3.1 can paginated response seems get_paginated_response() not available in 3.0. equivalent? class notelist(listcreateapiview): def list(self, request, *args, **kwargs): queryset = self.get_queryset() paged_queryset = self.paginate_queryset(queryset) serializer = noteserializer(paged_queryset, many=true) return self.get_paginated_response(serializer.data) it's paginationserializer , set serializer class by: 'default_pagination_serializer_class': 'yourcustompaginationserializer' or class myview(generics.genericapiview): pagination_serializer_class = yourcustompaginationserializerclass mixin.py def list(self, request, *args, **kwargs): instance = self.filter_queryset(self.get_queryset()) page = self.paginate_queryset(instance) if page not none: serializer = self.get_pagination_serializer(page) else: serializer = self.get_serializer(instance, many=true) return r

c++ - A* pathfinding not taking shortest path -

my a* pathfinding function gets intended destination, goes bit out of way. here's example: [i made nice image show issue, apparently won't post until reputation reaches 10; sorry, i'm new. :p] essentially, pulls left or as possible without adding more tiles path. sounds issue calculating gscore or possibly part tile's parent can reassigned based on neighboring tiles' gscores, can't figure out it's going wrong. i've combed on code weeks , browsed dozens of online posts, i'm still stuck. fyi, compiler/debugger have use doesn't support breakpoints or step-through debugging, i'm stuck simple text output. can spot i'm doing wrong? here's primary function (note: in angelscript. it's based on c++, there small differences): int cardinal_cost = 10; int diagonal_cost = 14; array<vector2> findpath(vector2 startposition, vector2 endposition) { //translate start , end positions grid coordinates startposition =

java - Bookmarks in a pdf not going to the correct pages nor any page for that matter. Why is this happening? -

i'm using netbeans , itext pdf api. have following method creates hashtable can inserted pdf. in case image files placed in pdf @ end of document. private hashmap<string, object> newtmp = new hashmap<>(); //to generate bookmarks images, object made private arraylist<hashmap<string, object>> bookmarks = new arraylist<>(); //an array list instantiated bookmarks saved private void bookmarkgen(string imagelist[]) { int n = 0; //counter used progress each bookmark. (int = 0; < imagelist.length; i++) { if (imagelist[i] != null) { bookmarks.add(newtmp); newtmp.put("title", imagelist[i].substring(imagelist[i].lastindexof("/"), imagelist[i].lastindexof("."))); newtmp.put("action", "goto"); newtmp.put("page", string.format("%d fit", n++)); system.out.print(n + "\n"); system.out.print("b

r - Fiting Weibull using R2OpenBUGS -

because estimation of parameters of weibull function using r2openbugs different amounts provided generate data set using rweibull? what's wrong fit? data<-rweibull(200, 2, 10) model<-function(){ v ~ dgamma(0.0001,0.0001) lambda ~ dgamma(0.0001,0.0001) for(i in 1:n){ y[i] ~ dweib(v, lambda) } } y<-data n<-length(y) data<-list("y", "n") inits<-function(){list(v=1, lambda=1)} params<-c("v", "lambda") model.file<-file.path(tempdir(), "model.txt") write.model(model, model.file) weibull<-bugs(data, inits, params, model.file, n.iter = 3000, n.burnin = 2000, n.chains = 3) print(weibull, 4) the result obtained is: current: 3 chains, each 3000 iterations (first 2000 discarded) cumulative: n.sims = 3000 iterations saved mean sd 2.5% 25% 50% 75% 97.5% rhat n.eff v 2.0484 0.1044 1.8450 1.9780 2.0500 2.1180 2.2470 1.0062 7

aes - how to store an encryption secret key safely -

i asked @ work protect sensitive data kept mysql database. database contains several tables, among 1 has critical data should accessed using api done in django. api there number of people have access it, persons able access data table. so, problem moment has access database , table, decided encrypt data table using aes, aid of aes_encrypt() , aes_decrypt() functions (according https://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html ). so.... point ok, main problem how store aes key used encryption/decryption. after brainstorming colleagues , google, found best thing use key wrapper ( http://en.wikipedia.org/wiki/key_wrap ), consists in encrypting original key (the master key) using keys belong persons can access api interacts database table. so, thinking encrypting key using public key of each person's public key has access api, , store encrypted version table can access. , then, when user needs master key, he/she needs retrieve encrypted key, decrypt his/her pri

python - Exporting Images from Vincent in ipython -

i've been using vincent in python make choropleth maps, i'd make them images use presentation. know how this? below code i'm using: county_borders = r'us_counties.topo.json' geo_data = [{'name': 'counties', 'url': county_borders, 'feature': 'us_counties.geo'}] choro_pop = vincent.map(data=counties_only, geo_data=geo_data, scale=1500, projection='albersusa', data_bind='census2010pop', data_key='fips', map_key={'counties': 'properties.fips'}) choro_pop.marks[0].properties.enter.stroke_opacity = valueref(value=0.5) choro_pop.rebind(column = 'estimatesbase2010', brew = 'orrd') choro_pop.to_json('counties_population_choropleth.json', html_out=true, html_path='counties_population_choropleth.html') choro_pop.display() this gives me map in ipython notebook (yay!) , outputs both html file , .json file. html file "scaffold&

Convert MySQL array format to PHP array -

this question has answer here: string / array format convert php 2 answers consider following mysql formatted array: a:14:{s:4:"type";s:6:"select";s:12:"instructions";s:0:"";s:8:"required";i:0;s:17:"conditional_logic";i:0;s:7:"wrapper";a:3:{s:5:"width";s:0:"";s:5:"class";s:0:"";s:2:"id";s:0:"";}s:7:"choices";a:17:{s:14:"2.25mm (b - 1)";s:14:"2.25mm (b - 1)";s:14:"2.75mm (c - 2)";s:14:"2.75mm (c - 2)";s:14:"3.25mm (d - 3)";s:14:"3.25mm (d - 3)";s:13:"3.5mm (e - 4)";s:13:"3.5mm (e - 4)";s:14:"3.75mm (f - 5)";s:14:"3.75mm (f - 5)";s:11:"4mm (g - 6)";s:11:"4mm (g - 6)";s:9:"4.5mm (7)";s:9:"4.5mm (7)

node.js - Passport JS and restify and Client sessions -

i'm stuck on error passport. building api using restify. using client-session session , passport google oauth 2. i having trouble @ point serialise user , create session. seem getting no errors printing out large node objects console. var restify = require('restify'); var massive = require('massive'); var passport = require('passport'); var googlestrategy = require('passport-google-oauth2').strategy; var _ = require('lodash'); var sessions = require("client-sessions"); var app = function(config, done) { // declare db , server var server = restify.createserver(), db; // set server settings server.use(restify.bodyparser()); server.pre(restify.pre.sanitizepath()); server.use(restify.queryparser()); server.use(sessions({ // cookie name dictates key name added request object cookiename: 'skyrail_session', // should large unguessable string secret: 'abc123yyighhcggfgucgdguhvgcydtfugjvhfguijkv

android - Setting a margin for NavigationDrawer items -

Image
my problem can't correctly set margin in navigation drawer. have tried changing margin of view , item doesn't seem work out. space between actionbar , navigationdrawer (and beginning of page). think problem inside listitem layout not sure. photo of get and layout , code files. main layout <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_height="match_parent" android:layout_width="match_parent" android:id="@+id/drawer_layout"> <android.support.v4.widget.swiperefreshlayout android:layout_height="match_parent" android:layout_width="match_parent" android:id="@+id/refreshsites" tools:context=".myactivity"> <android.support.v7.widget.recyclerview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/siteslist" andr