Posts

Showing posts from May, 2012

linux - Vim with incorrect colors - Konsole and Yakuake -

i'am using vim in konsole , yakuake. can't see correct colorscheme. my .vimrc file have following text: t_co=256 syntax enable set background=dark colorscheme desert my os debian sid. can me? you need csapprox plugin correctly display color schemes in terminal

java - How to change a value inside a third party library -

(you don't need know android solve question) i using third party library in android app. call libx. libx has class named constants in keep number of constants. 1 such constant used on inside library. need value of constant different is. how change value of constant? as illustration: want change value of badconstant “i bad” “i good” . class constants{ public static final string badconstant = “i bad”; } i open sort of creative solution. thing if had setter/constructor value well. right there no setter. also library obtained gradle dependency (if care)

python - Ansible 2.x install fails due to paramiko 2.0 dependency changes -

installing latest ansible via pip fails due paramiko 2.0 changing dependency pycrypto cryptography. cryptography has dependency on cffi, requires libffi-dev. know how fix this? (ubuntu trusty 14.04) run pip install --upgrade ansible ---> running in 8ef89649c480 collecting ansible /usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: snimissingwarning: https request has been made, sni (subject name indication) extension tls not available on platform. may cause server present incorrect tls certificate, can cause validation failures. can upgrade newer version of python solve this. more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning. snimissingwarning /usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: insecureplatformwarning: true sslcontext object not available. prevents urllib3 configuring ssl appropriately , may cause ssl connections fail. can upgr

javascript - ArialLabelledBy is not working -

i have control called _message. using sapui5 trying create text label , element id using jquery , set ariallabelledby element. when turn on narrator , click/hover or blue outline around th element selected doesn't read anything. am doing wrong? var olabel = new sap.ui.commons.label({text: "message screen reader"}); this._msgid = this._message.getid(); var textmsg = jquery("#" + this._msgid); textmsg.addarialabelledby(olabel); var olabel = new sap.ui.commons.label({text: "message screen reader"}); you have created html label non control element. should create textview element. you have created label object, have not inserted object in dom. you have insert object in dom before making association addarialabelledby reference existing object. (see placeat instance)

Break from for loop back into if statement vba -

i trying perform action see if date in range (daterng) less today's date, , then, if is, perform loop hide rows w.here value in column zero. (i paying off loans, , every month want hide loans have been paid off.) months across columns, loans in rows. loan balance (i, j). the problem never exits loop go , check date after every new 'j' (column). stays in loop. have tried break, exit, continue, etc. none seem work, @ least place them. how check date, compare 'today', run loop check each cell in column, before moving on column 2, checking date , performing same loop. it have dynamic, not necessary, every month change ranges in code. strictly personal use. appreciated. thank you. sub hidepaid() dim day range, loanrng range, loansum worksheet, daterng range, cel2 range, long, j long, col range set loansum = thisworkbook.worksheets("loan sum") loansum.activate set daterng = activesheet.range("d2:r2") set loanrng = activesheet.range("d

javascript - Passing data to model inside the ng-click -

i displaying of articles database , i've created simple text search it. <input ng-model="searchtext" placeholder="search articles" class="search-text"> and filtering content searchtext <section class="articles" ng-repeat="contentitem in content | filter:searchtext"> now i'm trying have buttons categories , tags database , able filter content based on button values. <span ng-repeat="category in categories"> <button ng-click="searchtext = '{{category.local.name}}'" class="btn btn-primary">{{ category.local.name }}</button> </span> the code above not working example if i'm taking out ng-repeat , type categories myself work: <span> <button ng-click="searchtext = 'some text'" class="btn btn-primary">some text</button> </span> my question how can way pass content search input , butto

ruby - Can't deploy Rails app to Heroku, "Invalid RUBY_VERSION" -

i'm trying push app heroku, can't past error: delta compression using 2 threads. compressing objects: 100% (1554/1554), done. writing objects: 100% (1652/1652), 23.93 mib | 369 kib/s, done. total 1652 (delta 859), reused 0 (delta 0) -----> ruby/rails app detected ! ! invalid ruby_version specified: there-was-an-error-in-your-gemfile,-and-bundler- cannot-continue. ! valid versions: ruby-2.0.0, ruby-1.9.3, ruby-1.9.2, ruby-1.8.7, ruby-1.9.3-jruby- 1.7.0, ruby-1.8.7-jruby-1.7.0, ruby-1.9.3-jruby-1.7.1, ruby-1.8.7-jruby-1.7.1, ruby-1.9.3-rbx-2.0.0dev, ruby-1.8.7-rbx-2.0.0dev ! ! push rejected, failed compile ruby/rails app git@heroku.com:myapp.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed push refs 'git@heroku.com:myapp.git' i'm running ruby 1.9.3p448. followed steps here , , top of gemfile includes: source 'http://rubygems.org' ruby '1.9.3' gem 'rails', '3.2.13&

cordova 3 - Custom template for platform add android -

what best approach create customized template platform add android? want customize www used , androidmanifest. using top level www customize www, best approach? possible / recommended make customized platform template? if recommended, best approach set up? for androidmanifest want default settings such these: <activity android:screenorientation="portrait" android:windowsoftinputmode="adjustpan"> </activity> i don't know if need answer yet. looking today. , found link jira . so, think can edit "platform/android/androidmanifest.xml" , cordova keep code. if still need custom androidmanifest, think need edit androidmanifest template cordova. regards,

sql - Removing rows when column has same value, and relating those rows to the same primary key in MySQL -

i'm working on project mysql 5.7 deals movies database. have following tables (that not allowed change): create table `movies` ( `id` int not null auto_increment, `title` varchar(100) not null default '', `director` varchar(100) not null default '', primary key(`id`) ) engine=innodb default charset=latin1; create table `genres` ( `id` int not null auto_increment, `name` varchar(32) not null default '', primary key (`id`) ) engine=innodb default charset=latin1; create table `genres_in_movies` ( `genre_id` int not null, `movie_id` int not null, foreign key (`genre_id`) references `genres`(`id`), foreign key (`movie_id`) references `movies`(`id`) ) engine=innodb default charset=latin1; i had records had updated reflect valid genres . unfortunately have bunch of duplicate genres.name though genres.id differs. consolidate equivalent genres.name single genres.id , genres.name . example, if have table: genres (old) ============

python - How can I import an external C function into an IPython Notebook using Cython? -

i'd import c function ipython notebook using cython. currently, i'm trying replicate example in cython documentation , compilation error. my python code (from ipython notebook): import cython %load_ext cython ---------------------------------- new cell %%cython cdef extern "spam.c": void order_spam(int tons) my c code: // spam.c #include <stdio.h> static void order_spam(int tons) { printf("ordered %i tons of spam!\n", tons); } running code, following traceback , error message: compileerror traceback (most recent call last) <ipython-input-13-8bb733557977> in <module>() ----> 1 get_ipython().run_cell_magic(u'cython', u'', u'\ncdef extern "spam.c":\n void order_spam(int tons)') /users/danielacker/anaconda2/lib/python2.7/site-packages/ipython/core/interactiveshell.pyc in run_cell_magic(self, magic_name, line, cell) 2118 magic_arg_s

scala - How to use a Filtered Service with RoutingService in Finagle -

fair warning, i'm new scala, missing simple here. i have code, works great import java.net.inetsocketaddress import com.twitter.finagle.builder.server import com.twitter.finagle.builder.serverbuilder import com.twitter.finagle.http.http import com.twitter.finagle.http.request import com.twitter.finagle.http.richhttp import java.util.logging.logger import com.typesafe.config.configfactory import org.jboss.netty.buffer.channelbuffers.copiedbuffer import org.jboss.netty.util.charsetutil.utf_8 import com.twitter.finagle.service import com.twitter.finagle.http.response import com.twitter.util.future import com.twitter.finagle.http.service.routingservice import org.jboss.netty.handler.codec.http.httpresponse import org.jboss.netty.handler.codec.http.httprequest import com.twitter.finagle.simplefilter object testserver extends app { val myservice = new service[request, response] { def apply(request: request) = { // if throw exception here

xslt - XSL: Converting External XML to readable XML -

a lot of question covered here, left few additional problems: apply xsl external xml here xml , xsl using: xml: <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="http://image1.frequency.com/xslt/sample.xslt" ?> <wrapper source="http://image1.frequency.com/xml/externalxml.xml"/> external xml <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/atom" xmlns:a="http://www.w3.org/2005/atom" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:gazeebo="http://www.vimond.com/vimondfeedextension/1.0" xmlns:machinima="http://xml.machinima.com/fields" xmlns:media="http://search.yahoo.com/mrss/" xmlns:plmedia="http://xml.theplatform.com/media/data/media"> <title>feed</title> <updated>2016-05-25t00:53:54z</updated> <entry> <

c - I'm trying to create a program with a loop that prompts the user to enter data in the array elements -

i'm trying create program loop prompts user enter data in array elements. , when user no longer can enter data, print screen data entered in last in, first out order. and attempt... #include <stdio.h> #include <math.h> #include <stdlib.h> #include <string.h> struct name_age { char name[10]; int age; }; void printme(struct name_age info) { printf("name: %s\n", info.name); printf("age: %d\n", info.age); } int main() { int size = 0, = 0, j = 0; struct name_age * array_ptr = (struct name_age*)malloc((size + 1)* sizeof(struct name_age)); struct name_age myinfo = *array_ptr; printf("enter size of array: "); scanf("%d\n", size); (i = 0; < size; ++i) { printf("enter name: \n"); scanf("%s\n", myinfo.name); printf("enter age: \n"); scanf("%d\n", myinfo.age); } printme(myinfo); return

mysql - how can I create incremental backups with xtrabackup automatically -

it says on manual if want create incremental backup can following command: xtrabackup --backup --target-dir=/data/backups/inc1 \ --incremental-basedir=/data/backups/base --datadir=/var/lib/mysql/ where /data/backups/inc1 incremental directory. if want create cronjob (which don't think i'm one), have figure out way name directory every time want create new incremental backup, tedious. is there way maje xtrabackup create directories using timestamps instead? you can use built-in linux command date name directory want, example xtrabackup --backup --target-dir=/data/backups/inc`date +%y%m%d` (rest options)

python - How to make 'seat' in user input returned as a float -

so in short python program, wrote: print "welcome receipt program!" while true: seat = raw_input('enter value seat: ["q quit"] ') if seat not seat.isdigit(): print "i'm sorry {} isn't valid. please try again.".format(seat) if seat == 'q': break else: continue print "*****" total = seat.count('$') print total how set so, whenever user enters number (a float specifically) seat (currently not possible in snippet), continues code , adds user inputs? beginner apologies if it's obvious answer. print "welcome receipt program!" seats = [] while true: seat = raw_input('enter value seat: ["q quit"] ') if seat == 'q': break try: seats.append(float(seat)) except valueerror: print "i'm sorry {} isn't valid. please try again.".format(seat) print "*****" print &#

python - Calling a function to execute a data tree -

i have code weighted score. def weighted_total_score(student_scores): return((int(student_scores[0])*mid_1_weight)+(int(student_scores[1])*mid_2_weight)+(int(student_scores[2])*final_exam_weight)+(int(student_scores[3])*homework_weight)+(int(student_scores[4][0])*lab_weight)+(int(student_scores[5])*pr_1_weight)+(int(student_scores[6])*pr_2_weight)+(int(student_scores[7])*pr_3_weight)+(int(student_scores[8])*participation_weight)) i call weighted_score in new function overall_grade. how call weighted_score gives me correct answer? when code executed, example, getting f instead of c. def overall_grade(weighted_total_score): weighted_total_score=int() if (weighted_total_score >=93): print("the overall student grade a") elif (90<=weighted_total_score<93): print("the overall student grade a-") elif (87<=weighted_total_score<90): print("the overall student grade b+") elif (83<=weight

javascript - Delayed number boxes in Chrome -

i've noticed number input has delay in firing onchange event if press up/down arrow buttons inside box. on other browsers mac safari , firefox, onchange event called immediately. see here: https://jsfiddle.net/yyfvv0vg/ <input type="number" max="9999" min="1" onchange="change()"/> <div></div> function change() { $("div").html($("input").val()); } is there way force update immediately, or fact of life have deal with? instead of onchange event try using onmouseup work. it seems while put cursor on arrows in chrome , data updated until move cursor out of arrows , try using , down keywords , see i'm telling you, data inmediatly updated.

ios - Wait with execution of viewWillDisappear until custom animation has completed? -

i'd perform animation when user taps on button segue root view controller. animation highlight changes user made in detail view controller. i tried this. animation works (and not essential question, left in illustrate i'm doing.) problem segueing happens fast , can't see animation. how can wait execution of viewwilldisappear until animation has completed? override func viewwilldisappear(animated: bool) { // ... // animate if text changes. reminderafterrulesrun custom data structure. remindernametextinput outlet label if remindernametextinput.text != reminderafterrulesrun.title { let originalremindernametextinputcolor = self.remindernametextinput.textcolor // animate removing of "all" , replacing commonly used list. uiview.animatewithduration(0.3, delay: 0, options: .autoreverse, animations: { // fade out self.remindernametextinput.textcolor = uicolor.redcolor

javascript - Iterating through jquery json -

can have external json file can connect , show data manually when iterate data.length (which 100) shows 100th data. here code var url ="output.json"; $.getjson(url, function(data) { (var i=0;i <= data.length; i++) { $('#stage').html('<h4>' + data[i].title + '</h4>'); } }); i think it's because you're overwriting #stage element every iteration. appending each data element might work better: var url ="output.json"; $.getjson(url, function(data) { (var i=0;i <= data.length; i++) { $('#stage').append('<h4>' + data[i].title + '</h4>'); } });

unix - How do I access remote Raspberry Pi camera over the network using Python? -

i've made simple pygame application access local machine camera follows : import pygame,sys import pygame.camera pygame.locals import * pygame.init() pygame.camera.init() stage= pygame.display.set_mode((640,480)) cameras = pygame.camera.list_cameras() cam=pygame.camera.camera(cameras[0],(640,480)) cam.start() while 1: image=cam.get_image() stage.blit(image,(0,0)) pygame.display.update() e in pygame.event.get(): if e.type==pygame.quit: pygame.quit() quit() i've been looking around way me access raspberry pi camera feed located in local network, hopping possible not changing of current code , change line : cameras = pygame.camera.list_cameras() find rpi camera on network instead of local machine adding rpi ip , login information, i'm starting realize maybe not possible way want it, if there similar way doesn't deal vlc player or other gui application fine me because intend use little possible of rpi memory , pro

java - Do ArrayLists that contain different types of objects use different amounts of memory? -

for example, if have int a=2; int b=3; arraylist<integer>integers=new arraylist<integer>(); integers.add(a); integers.add(b); and string c="cow"; string d="deer"; arraylist<string> strings= new arraylist<string>(); strings.add(c); strings.add(d); would take different amounts of memory? help/answer highly appreciated, thanks! the arraylists nothing more collection of references, , these take same amount of memory (if same size) no matter type of objects hold. items referred arraylist take differing amounts of memory expect.

c++ - Addition of two matrix using struct -

i'm trying sum 2 matrix using struct, doesn't work. if code can optimized please tell me :d compile with: g++ -o2 -wall program.cpp -o program output: in file included /usr/include/c++/4.8/iostream:39:0, proy3.cpp:2: /usr/include/c++/4.8/ostream:548:5: note: template std::basic_ostream& std::operator<<(std::basic_ostream&, const unsigned char*) operator<<(basic_ostream& __out, const unsigned char* __s) ^ /usr/include/c++/4.8/ostream:548:5: note: template argument deduction/substitution failed: proy3.cpp:51:30: note: ‘std::istream {aka std::basic_istream}’ not derived ‘std::basic_ostream’ cin << &m2.x[i][j]; code: # include < cstdio > # include < iostream > typedef struct matrix { int row, column; int x[20][20]; }; matrix m1,m2; using namespace std; int main() { cout << "insert size rows: mat[a]"; cin >> m1.row); cout <<

waf - check size of C type at build time -

i want establish build-time cross-language abi compatibility waf. how go checking size of type (or arbitrary type-like checks), , recording build configuration? you can create program outputs size. saw apporach on several ./configure files: cat << eof > test.c #include <stdio.h> int main () { printf("int %d\n", sizeof(int)); return 0; } eof $(cc) test.c -o out ./out >> sizes rm -f test.c out of course, testing of erroneous cases , such. edit : see waf documentation. specially, read run_c_code method. saving value of sizeof can write file instead , read python/waf. or, see define_ret argument.

linux - Use custom driver over an existing driver -

i'm learning how write linux drivers , pick usb stick had laying around. while struggling getting probe function called when plugged in. what happens probe called when unplug it,or atleast printk inside isn't called until then. disconnect function called. using bind , unbind drivers in /sys/bus/usb/drivers same thing. may 24 21:09:12 localhost.localdomain kernel: probed may 24 21:09:12 localhost.localdomain kernel: usb 1-2: usb disconnect, device number 16 may 24 21:09:12 localhost.localdomain kernel: discconect usb if rmmod uas , rmmod usb-storage plug in thumb drive works expected. i'm guessing these 2 existing modules causing kind of problem. there way drive use driver on usb-storage? module uas , usb-storage seem come on own. there 1 driver register device. have unregistered current driver. otherwise device use register driver. step 1 : run 'lsmode' command display modules loaded in linux kernel. step 2 : run 'modprobe -r <current

push notification - How to create a app in Bitnami parse-server -

i have hosted bitnami parse server in aws http service. unable create new app in parse server through dashboard. tried 1 hour demo bitnami parse-server in demo unable create new app. how this? https://bitnami.com/stack/parse i unable achieve through rest api also. because demo site doesn't required credentials login. /1/apps api call requires email/password create app. how create app in demo site? bitnami developer here, unfortunately, can not create new app using demo site. note app serve api. that, need access via ssh , edit /opt/bitnami/apps/parse/htdocs/server.js file. instance, have 2 apps code below: var express = require('express'); var parseserver = require('parse-server').parseserver; var app = express(); //api 1

spring - java.lang.ExceptionInInitializerError at UserDaoImpl.<clinit>(UserDaoImpl.java:71) -

it's testhelper: @runwith(springjunit4classrunner.class) @contextconfiguration(locations = { "classpath*:web-inf/spring/appservlet/servlet-context.xml" }) public class testhelper { @mock private userdaoimpl userdaoimpl; @injectmocks private helper helper=new helper(); private mockmvc mockmvc; string msg = "success"; int status = 200; responsemessage message = new responsemessage(); @before public void setup() { mockitoannotations.initmocks(this); this.mockmvc = mockmvcbuilders.standalonesetup(helper).build(); } @test public void testcategories() throws exception { message = helper.getcategories(0); assertnotnull(message); assert.assertequals(status, message.getstatus()); assert.assertequals(msg, message.getmessage()); } } it's helper class: public

javascript - Next-Previous button to work in loop using Bootstrap Tab -

currently "previous" button doesn't work in first tab since it's not in loop. how should go setting when visitors click on previous, shows last tab? html: <div> <ul id="wheel-tab" class="nav nav-tabs nav-justified"> <li class="active"><a href="#ocean" data-toggle="tab">ocean</a></li> <li><a href="#air" data-toggle="tab">air</a></li> <li><a href="#customs" data-toggle="tab">customs</a></li> <li><a href="#transport" data-toggle="tab">transport</a></li> </ul> <div class="tab-content"> <div id="ocean" class="tab-pane fade in active"> <h2>ocean</h2> <p>lorem ipsum dolor sit amet, consectetur adipisicing elit, se

scala command skips running main if class outside of singleton object -

edit: main method not called in scala script related (in particular, answer régis jean-gilles). post gives more details describe issue. , answer (by suish) give more practical demonstration explain behaviour of scala command. content of miniscalaapp.scala object miniscalaapp { def main(args: array[string]) = { println(s"scala version: ${scala.util.properties.scalaproporelse("version.number", "unknown")}") println(new dinosaur("tyrannotitan", 4900)) println(new dinosaur("animantarx ", 300)) } class dinosaur (name:string, weightkg: int) { override def tostring = f"$name, weight: $weightkg kg" } } executed @ command line by: $ scala /myproject/src/main/scala/miniscalaapp.scala produces expected output: scala version: 2.11.7 tyrannotitan, weight: 4900 kg animantarx, weight: 300 kg however, if dinosaur class placed outside of singleton object miniscalaapp scala command produces

c - Looking for C90 Grammar compatible with ANTLR 4 or MPlex/MPPG -

i wrote c90 cross-compiler in c# friend's custom cpu produces text file containg assembly language. feed assembler wrote in python, produces text file containing machine code. transmit machine via serial connection, , @ point custom cpu runs program. i bundle whole process simple pressing 'compile' button, in modern ide. also, speaking of modern ide's, nice develop our c code in other notepad , enjoy of amenities these modern ide's have offer such file management, in-place compilation, syntax highlighting, , intelli-sense. now, use visual studio of development aware comes bundled c/c++ compiler. nice able use visual c++ develop c code our custom cpu , override it's 'compile' feature invokes compiler tool-chain instead of c++ compiler. the problem envision approach that: i don't think it's possible override 'compile' feature and the syntax highlighting/intelli-sense not conform c90 standard. can live #2 know if #1 possible.

swift - Why is the base 64 encoding not working? -

i trying post username , password php script, works fine when not encoded, having trouble encoding on ios end. when print crypt <64584e6c 636d3568 6257566b 59585268 50556377 4e444134 4d546335 4a6e4268 63334e33 62334a6b 5a474630 59543172 6448526e 4e6a5935 4d673d3d> , based on tutorials should getting string along lines of bxkgcgxhbmkgdgv4da== var bodydata = "usernamedata=\(self.username.text!)&passworddata=\(self.password.text!)" request.httpmethod = "post" let encodestring = (bodydata.datausingencoding(nsutf8stringencoding)!); let crypt = encodestring.base64encodeddatawithoptions(nsdatabase64encodingoptions(rawvalue: 0)) request.httpbody = crypt print(crypt) i wouldn't recommend using encodestring variable name type nsdata (not string). the function base64encodeddatawithoptions returns nsdata. if want string bxkgcgxhbmkgdgv4da== , can use base64encoded string withoptions .

angularjs - how to show validate message in form in angular 2? -

i trying show validate message in form in angular 2 ? getting error cannot read property 'haserror' of undefined i added these lines <div *ngif="username.haserror('required') && username.touched" class="error-box"> username required</div> <div *ngif="username.haserror('minlength') && username.touched" class="error-box"> minimum password length 8!</div> here code https://plnkr.co/edit/slhyswt0mjxklogk1kfo?p=preview this should want: <ion-input type="text" ngcontrol="username" #username="ngform"></ion-input> <div *ngif="username.errors?.required && username.touched" class="error-box"> username required</div> <div *ngif="username.errors?.minlength && username.touched" class="error-bo

Move values from range while preserving formulas in Excel VBA -

i'm trying make macro moves values range another, while preserving formulas in range. so far have this: sub change_fiscal_year() sheets("1 income statement").range("e1:e23").value = sheets("1 income statement").range("d1:d23").value end sub it works, copypastes values instead of moving them, formulas not preserved. how can around this? try this: sheets("1 income statement").range("e1:e23").formula = sheets("1 income statement").range("d1:d23").formula

android - How to set color code as per Json Object -

i have following json response,i trying set color per displytext,but set last color code whole string, json response java code ch_list = new arraylist<string>(); color_list=new arraylist<string>(); try { (int = 0; < response.length(); i++) { jsonobject person = (jsonobject) response .get(i); system.out.println("person"+person); string searchcode = person.getstring("searchcode"); system.out.println("searchcode"+searchcode); jsonarray ja = person.getjsonarray("itemlist"); (int j = 0; j < ja.length(); j++) { jsonobject jo = ja.getjsonobject(j);

Actionbar in Android Null Pointer Exception -

i getting below null pointer exception actionbar caused by: java.lang.nullpointerexception: attempt invoke virtual method 'void android.support.v7.app.actionbar.setdisplayhomeasupenabled(boolean)' on null object reference i have used appcompatactivity extending activity , have changed in styles.xml in below way item name="windowactionbar">true</item> but still getting same error. tried changing getactionbar getsupportactionbar() still same error. i using these imports import android.support.v4.app.actionbardrawertoggle; import android.support.v4.widget.drawerlayout; import android.support.v7.app.appcompatactivity; import android.support.v7.widget.toolbar; i getting below null pointer exception actionbar please help. i think not using appcompact theme

SIgn IN Sign Up with Sqlite in android .Unable to solve -

i creating sign-in sign sqlite unable sign in. while sign working. please me problem? signup working fine unable click sign in. mainactivity import android.app.activity; import android.app.dialog; import android.content.intent; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.toast; public class mainactivity extends activity { edittext edittextusername, edittextpassword; button btnsignin, btnsignup; // string username,password; logindatabaseadapter logindatabaseadapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // create instance of sqlite database logindatabaseadapter = new logindatabaseadapter(this); logindatabaseadapter = logindatabaseadapter.open(); btnsignin = (button) findviewbyid(r.id.buttonsignin); btnsignup = (butt