Posts

Showing posts from May, 2010

syslog - What field does the Docker tag relate to in RFC 5424 -

my docker syslog tags being truncated @ seems 32 characters. when @ rfc 5424 not sure field is. know? trying verify allowed length tag can be. apr 19 06:43:05 ord-nodecore-prd-01 docker/core_sql_event_processor_ha[1207]: 2016-04-19t06:43:05.265z [sqleventhandler] event '3c5e1a15-f8a1-4bfa-b2fa-2e54b2a5fbaa' resulted in 0 relevant application events becomes: <30>apr 19 06:43:05 ord-nodecore-prd-01 docker/core_sql_event_processor_ 2016-04-19t06:43:05.265z [sqleventhandler] event '3c5e1a15-f8a1-4bfa-b2fa-2e54b2a5fbaa' resulted in 0 relevant application events note tag, docker/core_sql_event_processor_ha[1207]: here rfc link: https://tools.ietf.org/html/rfc5424#page-9 i thinking 'sd-name' may 'app-name'. no idea. your example has nothing rfc5424, , looks more rfc3164 (which not standard, collection of older best practices). please read this: https://tools.ietf.org/html/rfc5424#appendix-a.1 search 'tag ' - in essence, r

relational database - FileMaker - Total SubSummary Values -

i have table records each representing appointment. have name of contactthe appointment with, , date. in table have field contains how many appointments each contact supposed have during day. there 12 entries each contact, because expected have different numbers during different months. i able call data appropriate contactfor appropriate month. looks great in graph when count number of entries contact , put next expected number of entries related table. the problem i'm running need add of expected appointments between of entities. so: ::contactname:: ::appointments:: ::expected:: contact 12 10 contact b 33 34 contact c 18 27 getting roll actual appointments easy, simple count summary field in subsubsummary section. of expected? because contacta had 12 appointments means there 12 records them, putting summary field expected column return

If the number of properties is greater than n, return from a highly connected graph in Neo4j -

Image
this question direct extension of question asked here (and , earlier version here ). say have graph database looks this: just previous questions asked, interesting thing someproperty can 'yes' or 'no'. in top row, 1 of 3 nodes has 'yes' property. on bottom row, 3 nodes of 5 nodes have 'yes' property. ( slight philosophical sidenote : i'm starting suspect bad graph schema. why? because, within each set of nodes, each node in connected every other node. i'm not worried fact there 2 groups of nodes, fact when populate graph, talkback says, 'returned 530 rows.' think means created 530 subpaths within graph structure , seems overkill.) anyway, problem i'm trying solve pretty same problem trying solve in earlier, simpler, more linear context here . i want return full path of either of these disjoint graphs, whereas anywhere within said graph count occurrences of someproperty greater 2. i think common, simple pr

javascript - Jquery rotation rotate img on click -

good evening. @ moment using jquery rotate plugin allow image rotate clicked, image rotates 180 degrees once button clicked again go original position image keep 180 degrees rotation , can't figure out way of putting 0 degree position. can help? here code: html: <div class="box_one"> <div class="box_one_second" id="box-appear"> <p>some text</p> </div> <button id="button-one"><img id="arrowdown"src="#"/> </button> </div> jquery: $(document).ready(function(){ $("#button-one").click(function(){ $(".box_one_second").toggle(200); $("#arrowdown").css('rotate',180); }); }); i can see i'm rotating 180 this, how able reverse once user clicks button go original pos. thanks i'd recommend use jquery's toggleclass adding/re

ios - Xcode 7 record ui button doesn't appear -

Image
i created ui test class: import foundation import xctest @testable import testproject @available(ios 9.0, *) class changewishlistuitests: xctestcase { func testexample() { // use recording started writing ui tests. // use xctassert , related functions verify tests produce correct results. } } run app on iphone 6 simulator ios 9.3: but, record button, in tutorial: https://developer.apple.com/library/ios/documentation/toolslanguages/conceptual/xcode_overview/recordinguitests.html#//apple_ref/doc/uid/tp40010215-ch75-sw1 didn't appear. your cursor has inside method want implement (because xcode generates code cursor position) if doesn't help: sometimes xcode appears instable when add ui test existing project. following sequence helped me in cases: clean project restart xcode rebuild project click inside test method set cursor sometimes had 2 times. your simulator has run @ least ios 9.0

android - Cardview, cardCornerRadius not working -

i'm trying set cards cardcornerradius not working. take code below: cardview last property cardcornerradius <android.support.v7.widget.cardview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/user_card_view" android:layout_width="match_parent" android:layout_height="@dimen/card_height" android:layout_gravity="center" android:layout_marginbottom="@dimen/md_keylines" android:layout_marginleft="@dimen/md_keylines" android:layout_marginright="@dimen/md_keylines" android:foreground="?attr/selectableitembackground" android:theme="@style/themeoverlay.appcompat.dark.actionbar" app:cardcornerradius="3dp"> dependencies compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.android.support:design:23.3.0'

jquery - Append options to drop down box? -

i'm working on project want put drop down box , input text field in same td tag. here current code: <td > <label class="avbhide"> <select id="test" name="test"> <option value="">--select user--</option> </select> <input type="text" name="" id="block" class="email" value="" placeholder="example@gmail.com" title="enter email please."/> </label> </td> jquery code use populate dropdown box: var studvalues = []; studvalues.push({'idone':"13",'idtwo':"mike, pears"}); studvalues.push({'idone':"16",'idtwo':"steven, reed"}); studvalues.push({'idone':"14",'idtwo':"john, cook"}); for(var i=0; < studvalues.length; i++){ $('#test').append

c# - How to use SqlBulkCopy and track Bulk Inserts with Glimpse -

in our app use sqlbulkcopy class facilitate bulk loading of our database. recently, i've tried add glimpse our solution code fails invalid cast: system.invalidcastexception: unable cast object of type 'glimpse.ado.alternatetype.glimpsedbconnection' type 'system.data.sqlclient.sqlconnection' this because glimpse ado using wrapped sqlconnection make magic possible. unfortunately, sqlbulkcopy requires sqlconnection need cast dbconnection . is there no out-of-the-box way profile bulk insertions? work-around came across far is: (sqlconnection)((glimpsedbconnection)dbconnection).innerconnection it's ugly since requires referencing glimpsedbconnection explicitly , requires adding custom time-line events tracing. there no glimpse add-on solves this? i'm using approach (with entityframework's dbcontext ) , seems work: dbcontext db = /* ... */; var glimpsedbconnection = db.database.connection glimpsedbconnection; var sqlconnection

machine learning - Generating a Decision Tree that Perfectly Models the Training Set? -

i have data set rules, , want generate decision tree @ least has 100% accuracy @ classifying rules, can never 100%. set minnumobjs 1 , made unpruned 84% correctly classified instances. my attributes are: @attribute users numeric @attribute bandwidth numeric @attribute latency numeric @attribute mode {c,h,dcf,mp,dc,ind} ex data: 2,200000,0,c 2,200000,1000,c 2,200000,2000,mp 2,200000,5000,c 2,400000,0,c 2,400000,1000,dcf can me understand why can never 100% of instances classified , how can 100% of them classified (while still allowing attributes numeric) thanks it impossible 100% accuracy due identical feature vectors having different labels. guessing in case users , bandwidth , , latency features, while mode label trying predict. if so, there may identical values of { users , bandwidth , latency } happen have different mode labels. in general, having different labels same features may occur through 1 of several ways: there noise in data due bad reading

installer - Installing USB drivers before plugging in the device -

we have device requires install drivers before it's plugged in, otherwise need remove drivers windows 8 , 10 automatically download. how make usb driver installer can install correctly whether it's plugged in first or not? on windows 10, simple driver usbser.sys inf file , cat file automatically take precedence on microsoft's usbser.inf supply in windows 10. if doesn't happen particular driver/device, might using devcon , open source utility microsoft can used list devices , update drivers. have never used devcon in installer, think have noticed other installers use it. there msys2 package devcon.

Center of a cluster of latitude and longitude points in Google map android -

Image
i trying center of shape in android. shape draw hand on map. have of co-ordinates mean values turning out trickier thought. want plot marker on mean latitude , longitude. i have tried summing latitude , longitude separately , dividing number of points. not give correct answer. marker seems trailing behind draw figure. have tried using implementation gives same answer, previous question, calculate center point of multiple latitude/longitude coordinate pairs the code have been using: private void calculatefreehandpolygonparameters(){ double xvalues = 0; double yvalues = 0; double zvalues = 0; int count = 0; // linesforpolygon list of lines in polygon for(polyline line : linesforpolygon){ (latlng point : line.getpoints()) { xvalues += math.cos(math.toradians(point.latitude)) * math.cos(math.toradians(point.longitude)); yvalues += math.cos(math.toradians(point.latitude)) * math.sin(math.toradians(point.longitude));

php - Publish CalDav events for site members and manage participants -

i'm running php site user database , shared calendar (events) moderated database. i want publish these events in ical/caldav members can: get calendar events, in sync, authentication (private url...) join event (but not create or modify event) the app shall leverage site existing user & calendar database. i've looked @ caldav implementations in php & python, seem complicate simple usage: sabre/dav has experimental shared calendar support, , leveraging existing user database seems tricky. davical seems have own user database, complex acl schemes, etc. etc. how that? use caldav/ical library adapted? idea of library job? write own caldav/ical server, risk of poor client support. edit: useful links use sabre/dav existing website database: using external databases edit: improvements: although works expected, sabre/dav way too slow in creating server-side event invites ~100 local people ("principals"). , generates 99x usel

javascript - How to program next div automatically after 5 seconds -

i'm developing new website , need change frame after 7 seconds. idea first frame, after 7 secs frame 2, , after 7 secs frame 3 has button proceed. can me out that? the code have far is: <header id="home"> <div id="home-slider" class="carousel slide carousel-fade" data-ride="carousel"> <div class="carousel-inner"> <div class="item active" style="background-image: url(images/slider/1.jpg)"> <div class="caption"> <h1 class="animated fadeinleftbig">bem vindo </div> </div> <div class="item" style="background-image: url(images/slider/2.jpg)"> <div class="caption" <h1 class="animated fadeinleftbig">nÓs somos </h1> </div> </div> <div class="item" style="background-image: url(images/slider/3.j

html - Can I use Fontello font for commercial use -

i use fontello templates sell. didn't understand license's documentation well. can use commercial use or not? different fonts have different licenses, seems fontello includes fonts allow commercial use. (see section 2 below.) all licenses defined original fonts authors. fontello doesn't add additional requirements. license type shown on right font name. fontello includes fonts, not have limits websites (non-commercial use, mandatory links, mandatory attribution, , on). since open source developers, don't wish restrict freedom. you can use fonts on website , happy, it's considered practice credit authors in unobtrusive way. there no need inform entire world on main page big letters, site uses font xxx. if interested know - it's when can find such info. for convenience, prepare license file attribution in each generated archive. includes info fonts selected glyphs. source: https://github.com/fontello/fontello/wiki/what-abo

jquery - Detect if element is in view of Bootstrap modal? -

i'm loading separate html page bootstrap modal window. in modal, there elements need animate using animate.css . can part work, problem can't figure out how determine when element want animate in view in viewport when modal open can use jquery add animate classes. help? thanks! i haven't tried think shall work. first add class elements invisible default: .el { visibility: hidden; } then check when modal gets opened , change css js visibility: visible; $('#mymodal').on('shown.bs.modal', function () { $('.el').css('visibility', 'visible'); }); i suppose attached animations start running right after.

Once we create trigger in php page then do we need to create same in Mysql? -

i using mysql database purpose php code. i have created trigger in php code below, need create in mysql?? my following insert data table, , show content of tables. action performed in trigger not make change. there problem in trigger? once started working fine after changed table name stopped working though kept table name same php page , mysql. <html> <body> <?php $id=$_post['id']; $fname=$_post['fname']; $lname=$_post['lname']; $city=$_post['city']; $con=mysqli_connect('127.0.0.1:3306' ,'root','root','my_db'); if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $sql1="select * student"; $result = mysqli_query($con,$sql1); echo "<table border='1'> <tr> <th>id</th> <th>firstname</th> <th>lastname</th> <th>city</th> </tr>"; while($row = mysqli_fetch

django - pytest-cov cover many applications at once -

i built django project many applications. want generate coverage report these applications. testing purposes, use py.test, pytest-django , pytest-cov. far, can generate report typing app names manually on command line: py.test --cov-report html --cov=app1 --cov=app2 --cov=app3 --cov=app4 */tests.py does pytest-cov have way specify applications simple expression? assuming you're using bash, use expand parameters: py.test --cov-report html --cov=app{1,2,3,4} */tests.py you add parameters pytest.ini they're passed automatically on each invocation.

Apply changes across the page. Jquery -

i have these lines of jquery code manipulate html $('#remarks li:gt(1)').wrapall('<ul class="btmrow" />'); $("#btrowmargin").appendto("#remarks"); $('#remarks ul:lt(2)').wrapall('<li class="btmrow" />'); i want above code take effect across page ever #remarks present. wrote $.each($("#remarks"), function() { $('#remarks li:gt(1)').wrapall('<ul class="btmrow" />'); $("#btrowmargin").appendto("#remarks "); $('#remarks ul:lt(2)').wrapall('<li class="btmrow" />'); }); but doesn't seem working. jsfiddle here originally html looks <li> <ul id="remarks" class="remarks"> <li class="header soldbkg">showing information</li> <li><p><b>remarks:</b></p></li> <li><sp

apache - Restler setup not working -

on webserver running apache/2.2.26 (unix) dav/2 php/5.4.24 mod_ssl/2.2.26 openssl/0.9.8y trying setup restler can't seem handle index.php properly. webapp setup httpd.conf looks so: alias "/dts2" "/usr/local/webapps/dts/root" <directory "/usr/local/webapps/dts/root"> allowoverride options -indexes followsymlinks </directory> so went 'root' directory , ran command install restler: composer create-project restler/application=dev-basic api --prefer-dist after that, in 'api' directory created .htaccess file looks so: directoryindex index.php <ifmodule mod_rewrite.c> rewriteengine on rewriterule ^$ public/index.php [qsa,l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ public/index.php [qsa,l] </ifmodule> <ifmodule mod_php5.c> php_flag display_errors on </ifmodule> and, when try access " https://..../dts2/api/home/ &

angularjs - Bluemix Cors disable Node.js -

i not able avoid error on browser - xmlhttprequest cannot load https://xyz.mybluemix.net/get_user_byid.response preflight request doesn't pass access control check: no 'access-control-allow-origin' header present on requested resource. origin ' http://a.x.y.z:9000 ' therefore not allowed access. response had http status code 404. i using every measure required allow cross origin calls, still gives me error. var app = express(); var cors = require('cors'); app.use(cors()); app.use(function(request, response, next) { response.header("access-control-allow-origin", "*"); response.header("access-control-allow-headers", "origin, x-requested-with, content-type, accept"); response.header("access-control-allow-methods", "get, post, put"); next(); }); app.get('/get_users', cors(), function(req, res) {...} i calling api - (standard $http angular way) return $http.post(bas

http - What is the proper way to detect a dropped connection in Go? -

i working go http server implementation reads upload mobile client. however, i'm experiencing problems because of long keep-alive, server hang reading request buffer quite long time if mobile client goes offline (as happens). what proper way detect dropped connection , close input buffer? set reasonable timeout on server, example: srv := &http.server{ addr: ":443", readtimeout: time.minute * 2, writetimeout: time.minute * 2, } log.fatal(srv.listenandservetls(certfile, keyfile))

java - Where to put popup code -

so i'm making gui menu drop downs. wanted have gui create popup window whenever user selects option drop down menu. should put code popup within actionperformed method or make separate method , call somewhere else? here code: import java.awt.container; import java.awt.flowlayout; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.japplet; import javax.swing.jframe; import javax.swing.jmenu; import javax.swing.jmenubar; import javax.swing.jmenuitem; import javax.swing.jtextfield; public class finalgui2 extends japplet{ private jtextfield text = new jtextfield(10); private actionlistener listen = new actionlistener(){ public void actionperformed(actionevent e){ } }; private jmenu[] menu = {new jmenu("food"), new jmenu("fluid"), new jmenu("sleep")}; private jmenuitem[] items = {new jmenuitem("add"), new jmenuitem("add"), new jmenuitem("add"), new jmenu

PHP mySQL, how to get data from mysql for today ranging between 2 dates -

Image
i have 2 columns in mysql table, valid_from & valid_till both have dates in them. i want record today's date example if today 2016-04-22, , there record in table has valid_from & valid_till dates , today's date falls within range of record, want record. my question how can that? thank you! the image of table: this way test if date, example today's date, id between valid_from date , valid_till date: select * (table_name) (date_to_test) > valid_from , (date_to_test) < valid_till;

bash - Auxiliary piping for shell input output redirection -

in script need output special commands pre-defined file descriptor along usual stdout-stderr , listen commands in program without creating file. essentially it's redirection pipe, roundabout through using other file descriptor(s) or socket or device: usual way redirecting stdout(1) stdin(0): > program1 | program2 what need (some redirection, uses other descriptor e.g. 5): > exec "open descr 5 <>5" > program1 ??5?? & program2 <5 & program1 "knows" descriptor number 5 , outputs fwrite(5, ...) , program2 uses usual stdin redrection. how can roundabout redirection in shell? you can't. way semaphore use fifo file, you've said don't want make file. file descriptors define, exist in shell, subprocess or program unaware of them.

javascript - Why do Promises capture syntax errors? -

why native promises act try/catch when comes syntax errors? promises have value in flow control when need perform number of async operations in order. necessity of having implement own inadequate error handing implementations every promise makes them hassle work with. take following code: asdf let 1 = new promise((resolve, reject) => { asdf }).catch(err => { console.log(err) console.log(err.stack) }) the first syntax error produces typical browser error , stack trace 18 entries. promise'd version has 4. so question why, when writing spec , implementing natively, did retain try/catch functionality of userspace implementation of promises used flow control leave standard error handling? an actual syntax error thrown javascript parser when code loads , still thrown exception. when parser decides can't parse code, there's nothing else @ point. give , stop parsing rest of code. it runtime errors (that happen during code exe

Johnson C++ algorithm compiling error -

i'm using code of jonhson algorithm https://gist.github.com/ashleyholman/6793360 , when compiling it's throwing me errors, of these i've solved, there's others i'm not understanding can be... i'll post here, compiling errors. 33 error: expected expression 43 error: expected expression 85 error: expected expression 103 error: expected expression 105 error: expected expression 159 error: expected ';' @ end of declaration the code using c++11 features such range-based loop , list initialization etc. compile code -std=c++11 or -std=c++14 flag. as you're using codeblocks, here's how: settings compiler compiler settings compiler flags mark option have g++ follow c++11 standard try compile

some examples of algorithm complexity of nested loops? -

i have seen in cases complexity of nested loops o(n^2), wondering in cases can have following complexities of nested loops: o(n) o(log n) have seen somewhere case this, not recall exact example. i mean there kind of formulae or trick calculate complexity of nested loops? when apply summation formulas not right answer. some examples great, thanks. here example time complexity o(n), have double loop: int cnt = 0; (int = n; > 0; /= 2) { (int j = 0; j < i; j++) { cnt += 1; } } you can prove complexity in following way: the first iteration, j loop runs n times. second iteration, j loop runs n / 2 times. i-th iteration, j loop runs n / 2^i times. in total: n * ( 1 + 1/2 + 1/4 + 1/8 + … ) < 2 * n = o(n) it tempting runs in o(log(n)) : int cnt = 0; (int = 1; < n; *= 2) { (int j = 1; j < i; j*= 2) { cnt += 1; } } but believe runs in o(log^2(n)) polylogarithmic

How to use the constructor? java -

package aprilchap3; /** * * @author ericaross */ public class savingsaccount { double interest; double balance; public savingsaccount() { balance = 0; interest = 0.1; } public void addinterest() { balance = interest*balance + balance; } public void deposit(double amount) { balance= balance + amount; } public void getbalance(){ return balance; } } ``and savingsaccounttester class: package aprilchap3; /** * * @author ericaross */ public class savingaccounttester { public static void main(string[] args) { savingsaccount erica = new savingsaccount(); erica.deposit(1000); erica.addinterest(); double ericabalance = erica.getbalance() ; system.out.println(ericabalance + "this how owe. ");` } } so problem want use constructor set value instead of depositing, when try error shows in savings account declaration. here want put savingsaccount erica = new saving

sql - Trouble With Encryption in Oracle11g -

i working on lab attempting encrypt dummy ssn , provide output in sql plus shows unencrypted ssn, encrypted ssn, , decrypted ssn. the value encrypting 555 55 5555, decrypted value appears 33353335333532303335333532303335333533353335. i'm not quite issue lies, since appears @ least decryption occurring. suggestions appreciated. sql below set serveroutput on declare ssn varchar2(200) := '555 55 5555'; ssn_decrypt varchar(200); ssn_raw raw (200) := utl_raw.cast_to_raw(ssn); num_key_bytes number := 256/8; key_bytes_raw raw (32); encryption_type pls_integer := dbms_crypto.encrypt_aes256 + dbms_crypto.chain_cbc + dbms_crypto.pad_pkcs5; encrypted_raw raw (2000); decrypted_raw raw(2000); begin dbms_output.put_line('the unencrypted ssn is: ' || ssn); key_bytes_raw := dbms_crypto.randombytes (num_key_bytes); encrypted_raw := dbms_crypto.encrypt ( utl_i18n.string_to_raw (ssn), typ => encryption_type,

c++ - undefined reference to CLASS::function() -

so when try compile code using "g++ asg5.cpp" receive following error /tmp/cczhpsgo.o: in function 'main': asg5.cpp:(.text+0x2fb): undefined reference 'binomialtree::insert(int)' collect2: ld returned 1 exit status if anyone's wondering why i'm not using makefile, professor wants type g++ <.cpp main()> compile.. anyway here's code appreciate assistance! asg5.cpp #include "binomialtree.h" #include "binomialnode.h" #include <iostream> #include <vector> #include <fstream> #include <sstream> #include <stdlib.h> #include <string> #include <stdio.h> using namespace std; int main(int argc, char* argv[]) { //input handling if(argc != 2) { cout << "incorrect usage. \n example: ./a.out <filename>" << endl; exit(1); } binomialtree *tree = new binomialtree(); char *buffer; char *token;

android - Navigating back to Parent activity with toolbar -

so break down. i have 2 activites: main activity , subactivity. when in subactivity, want press return home button on toolbar , return home. i tried putting android.support.parent_activity in manifest, still couldn't work. maybe i'm not seeing obvious here. hope guys can help. here subactivity. @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.final_create_cardview_1_image); //toolbar mytoolbar = (android.support.v7.widget.toolbar) findviewbyid(r.id.app_bar_pic); setsupportactionbar(mytoolbar); getsupportactionbar().sethomebuttonenabled(true); getsupportactionbar().setdisplayhomeasupenabled(true); } private void setsupportactionbar(toolbar mytoolbar) { } @override public boolean onoptionsitemselected(menuitem item) { int id = item.getitemid(); if(id == android.r.id.home) {

highcharts - How to reference external javascript files from a SharePoint 2010 Content Editor Web Part -

i'm trying set basic highcharts example using sharepoint 2010 content editor web part, error message "object doesn't support property or method 'highcharts'" . i'm using example content directly highcharts download. reason, script @ top of code not being loaded or i'm not able access it. i'm guessing has way sharepoint loads other scripts, i'm not sure. <script src="https://teamone.com/sites/sandbox/mmg/christo/shared%20documents/hichartsapp/js/jquery-1.11.3.min.js"></script> <script src="https://teamone.com/sites/sandbox/mmg/christo/shared%20documents/hichartsapp/js/highcharts.src.js"></script> <div id="charts_holder"> <h2>hicharts test page</h2> <p>this charts live</p> </div> <div id="container" style="width:100%; height:400px;"></div> <script type="text/javascript"> $(document).ready(function ()

sending data from activity to a method implemented in a fragment -

i have read through many posts on here sending data activity fragment or should invoking method in main activity implemented in fragment class whhat have described below. im looking way other implementing interfaces or putting code in oncreate of activity or oncreateview of fragment. have function in fragment class public void speaker(string msg){ tts.speak(msg, texttospeech.queue_flush, null); } is possible call function anywhere in main activity pass string value function speaker(text); , how accomplish other interfaces or putting code in oncreate or oncreateview??

java - ERROR in sqlite database connectivity -

this question has answer here: what nullpointerexception, , how fix it? 12 answers kindly me resolve error. getting error in android studio. new android development. problem registration..not able insert data database. error is: caused by: java.lang.nullpointerexception: attempt invoke virtual method 'android.database.cursor android.database.sqlite.sqlitedatabase.rawquery(java.lang.string, java.lang.string[])' on null object reference db_connectivity package com.freedomkitchen.sonali.freedomkitchenandroidapp; import android.annotation.suppresslint; import android.content.intent; import android.database.cursor; import android.database.sqlite.sqlitedatabase; import android.os.bundle; import android.support.v7.app.actionbar; import android.support.v7.app.appcompatactivity; import android.view.view; import android.widget.toast; import com.freedomkitchen.s

excel - Pandas: Remove aggfun np.sum labels and value labels from pivot table -

i have created pandas pivot table, , trying remove 'sum' , 'length' rows output xlsx. so far have tried remove 2 rows upon exporting pivot table xlsx. have tried read in exported pivot table , dataframe.drop 2 rows , re-export. i not having luck. in advance! link pic: http://i.stack.imgur.com/amjfy.png you can use droplevel : df.columns = df.columns.droplevel([0,1]) print df status x y z code 13.0 6 20 b nan 472 472 c nan 105 105 d 13.0 584 598 and maybe reset_index rename_axis (new in pandas 0.18.0 ): df = df.reset_index().rename_axis(none, axis=1) print df code x y z 0 13.0 6 20 1 b nan 472 472 2 c nan 105 105 3 d 13.0 584 598

mysql - LEFT JOIN, add to array in PHP if results from second table exist -

i trying expand functionality of dictionary building showing definitions of terms (if definition exists). i take data 2 tables follows: $query = $db->query("select * ".dictionary_table." " . "left join ".dictionary_definitions." on ".dictionary_table.".id = ".dictionary_definitions.".term_id ". "where ".dictionary_table.".".$source." '%".$keyword."%' ". "and ".dictionary_table.".theme_id = ".$selected_theme_id." ". "order ".dictionary_table.".id"); after that, in while loop, first theme name (from table), add query results array: while($row = $query->fetch(pdo::fetch_assoc)) { // theme name $theme_name = "theme_".$lang; $theme_query= $db->query("select theme_id,".$theme_name." ".dictionary_themes." theme

python - Trying to cycle through jobs with a button press -

please forgive beginner question. heard word python 2 weeks ago. i trying write python 2.7 script has 2 jobs run in , pm. reminder program reminds me every day @ 9am , 9pm. reminds me hourly after that. want try , figure out way gpio button press stop current job, allow next scheduled job occur. idea these 2 jobs run every day, button press says, "stop job , wait next scheduled job". once reminder has "reminded me", button press stops nagging. here basic code i've started writing: #!/usr/bin/python import schedule import time import rpi.gpio gpio gpio.setmode(gpio.bcm) # gpio 23 set input. pulled stop false signals gpio.setup(23, gpio.in, pull_up_down=gpio.pud_up) def am_job(): print 'this job' def pm_job(): print 'this pm job' schedule.every().day.at("9:00").do(am_job) schedule.every().day.at("10:00").do(am_job) schedule.every().day.at("11:00").do(am_job) schedule.every(

c# - Append to Global List -

i started learning wpf , c#. have global list want append on event. code: public partial class mainwindow : window { public list<user> items = new list<user>(); someeventhandler { items.add(new user() { name = "john", age = 42 }); listviewusers.itemssource = items; } } however, updated first time event fires, , not subsequent events. if move public list<user> items = new list<user>(); to someeventhandler, listviewusers show latest update , not previous record. how append items? although prefer bind in xaml via viewmodel, solve problem, should use observablecollection below. automatically update listview if item added in collection: public partial class mainwindow : window { public observablecollection<user> items = new observablecollection<user>(); public mainwindow() { initializecomponent(); list

email - scan a file using python for a specific string -

this related question writing xml document. im trying read email file (txt/html) doesnt matter on format, know how specific string (i.e. build) never in same place twice , has associated string of interest me? btw, i'm writing script in python. can provide example of type of email i'm referring when comes looking information im trying use. my code sits: open('daily build email 07012013.txt','r') x: b = 1 linka = b linkm = b line in x: print b,' + ',line if "link1" in line: linka = line string.strip (s[link1: ]) print "link ", linka #else: # continue if "link2" in line: linkb = line print "link ", linkm else: continue b += 1 x.close() the string strip make line contain network location linka , linkm, because of leading characters in line before \ in opened file ne