Posts

Showing posts from August, 2010

Delphi - Is there a way to hide/organize Components in DESIGN mode -

in delphi 2010... building reasonably complex application. there kinds of non-visual vcl based components, such ttable, tquery, etc. know can put data oriented components datamodule, in design time, don't show on main form. looking way "hide" other non-visual components. know can hide them gexperts, click on form, show again. seem recall there 'component repository' type of component. dropped on form, , dropped other components it... can't find though. is aware of way accomplish this? thanks just put other non-visual components on datamodule well. non-visual controls can placed there; it's visual (tcontrol/twincontrol) components can't (for obvious reasons - data module has no visual aspect @ runtime). note useful in applications don't access databases of sort. can still create tdatamodule hold of non-visual components image lists, file open/save dialogs, , forth.

java - JavaFX Application returning NullPointerException when other Scene is called (just sometimes) -

my application has login scene , main view scene, happening when login , mainview called exception: java.lang.nullpointerexception @ javafx.scene.scene.focusinitial(scene.java:1879) @ javafx.scene.scene.access$3600(scene.java:170) @ javafx.scene.scene$scenepulselistener.focuscleanup(scene.java:2181) @ javafx.scene.scene$scenepulselistener.pulse(scene.java:2221) @ com.sun.javafx.tk.toolkit.firepulse(toolkit.java:363) @ com.sun.javafx.tk.quantum.quantumtoolkit.pulse(quantumtoolkit.java:460) @ com.sun.javafx.tk.quantum.quantumtoolkit$9.run(quantumtoolkit.java:329) @ com.sun.glass.ui.win.winapplication._runloop(native method) @ com.sun.glass.ui.win.winapplication.access$100(winapplication.java:29) @ com.sun.glass.ui.win.winapplication$3$1.run(winapplication.java:73) @ java.lang.thread.run(thread.java:722) the curious doesn't happening always, just sometimes. my class: public class targetappdesktop extends application { @overr...

asp.net mvc - Bad Request - Invalid Hostname - Host files already fixed -

according other questions problem has been solved editing hosts file , applicationhost file. these 2 files setup on machine. error started ocurrring right after upgraded visual studio 2015 sp1 http://bdtest.localhost:50119/ returns bad request hosts file - localhost name resolution handled within dns itself. 127.0.0.1 localhost ::1 localhost 127.0.0.1 bdtest.localhost application hosts file <site name="bizdox.web" id="2"> <application path="/" applicationpool="clr4classicapppool"> <virtualdirectory path="/" physicalpath="c:\source\bizdox\summer2015-navigation\bizdox.web" /> </application> <bindings> <binding protocol="http" bindinginformation="*:50119:*"/> <binding protocol="http" bindinginformation="*:50119:localhost" /> <binding protocol="http" bind...

transform - R stats, transforming parts of a data matrix -

i new both stackoverflow , r stats, please bear me. have lot of experience coding in sas, trying learn r. commonly use sas , r transform large datasets, have species study site matrix follows: species status role site1 site2 site3...site25 a_a s p 0 0 0 1 a_b x 1 25 0 0 b_a s p 0 2 1 1 b_b s x 0 1 0 0 ... i transform table , create 2 new variables called "site" , "count" based on site variable names , count data within each site: species status role site count a_a s p site1 0 a_a s p site2 0 a_a s p site3 0 a_a s p site25 1 a_b x site1 1 a_b x site2 25 a_b x site3 0 a_b x site25 0 ... b_b s x site25 0 i think may beyond simple t() function, , have looked packages reshape , reshape2, kind of lost how proceed. have had situation , lend h...

architecture - JWT Authentication and user validation -

i'm not sure understand concepts of how proper jwt authentication must work. have found article jwt authentication author talks that: ..the token self-contained, client need resend server each request, , server have check signature ensure validity. no more useless call database or ldap. i'm little bit concerned phrase- no more useless call database or ldap but how check example user still exists in system or user has not been banned , token has been expired ? looks need make call database or ldap in order information , compare info inside of jwt token. isn't ? you correct if must check on every call, need query database or call authorization server. but point jwt tokens should have short enough lifetime should not have worry this. if token expires every hour, , user deleted or banned, he/she have access apis @ hour (or whatever token lifetime is). client needs renew token , figures out user no longer valid. not having query database or call ...

Android setting share option visibility on fragments managed by tabs in sliding tab layout -

i have been struggling implement switching visibility of share option on menu between fragments. using sliding tab layout , has fragment in each of 2 tabs. first tab (uses list view) , when item selected, setting flag true , calls invalidateoptionsmenu() , works fine showing share option on app bar menu, not able cancel when move other fragment has preferences. code similar below. public void setsharedintenttext(string text) { sharedtext = text; if (shareoptionvisibility == false) { shareoptionvisibility = true; invalidateoptionsmenu(); } public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.menu_main, menu); // locate menuitem shareactionprovider menuitem shareitem = menu.finditem(r.id.menu_share); // fetch , store shareactionprovider mshareactionprovider = (shareactionprovider) menuitemcompat.getactionprovider(shareitem); sendintent.setaction(intent.action_send); sendintent.settype("tex...

javascript - jQuery Replace label with ASP.NET dropdownlist -

i building editable form using data database requires use of asp.net control. got working in html, when added .net part, got stuck. here's situation: have label displayed on page edit button below it. what's supposed happen once edit button pressed, label becomes .net dropdown list data database. once user clicks save, dropdown list go label displaying selected value. my problem when click edit button, dropdown list never appears. here's code: .ascx <li> campus <br /> <span class="datainfodropdown"> <strong> <asp:literal id="campusattended" runat="server" clientidmode="static"/> </strong> <asp:dropdownlist id="profilecampusdropdown" runat="server" clientidmode="static" style="display:none;" ></asp:dropdownlist> </span> <a href="#" class="editlinkdropdow...

printing - awk: print columns based on values of another column -

i have file 6 columns, , want print first 2 columns of lines have value >3 in sixth column. this statement prints lines sixth column > 3 awk '$6 > 3' file > out this statement prints first 2 columns: awk '{print $1,$2}' file > out anyone knows how combine these 2 commands one-liner? you there,just said, "combine them"! . try this: awk '$6>3{print $1,$2}' file >out

Codeigniter allow .php file uploads -

i using codigniters built in file upload library, , want allow php files uploaded. this facility available admin users behind secure login etc. but reason, getting 'the filetype attempting upload not allowed' errors. i have in controller: $config['allowed_types'] = 'pdf|doc|docx|php'; and have line in config/mimes.php: 'php' => 'application/x-httpd-php', this actualy functionality works if try upload image file etc, working, not allowing .php files. any ideas why doesnt work? missing something? figured out!! when looked @ posted data, mime type content-type: text/php but corresponding mime type in mime.php was: 'php' => 'application/x-httpd-php', so changed to: 'php' => array('application/x-httpd-php', 'text/php'), and worked. hallelujah!!

php - show numbers there are not in a column in MySQL -

i have formfield can put in numbers in value between 1 - 10. numbers saved in mysql database. looking how make query can return numbers in database, has not been put in through formfield. fx: if following number has been put in: [1,4,8,9,10] have div tag there printing numbers out. that means following numbers need printet in div tag is: [2,3,5,6,7] but quite in doubt how that, because numbers not exist in database yet, because number has not been put in yet. update: if there has been typed in 1000 numbers between 1 - 10, numbers of course registred. query should work 5 numbers have been registered fewest times showing up. i have tried this, of course not working. maybe can use start?: $stmt = $mysqli->prepare("select numbers numbertable group numbers order count(*) asc limit 10;"); best regards mads like this: select numbers yourtable numbers not in (2,3,5,6,7) that's basic idea of how syntax works. want build "not in" list,...

php - HTTP PUT Request: Passing Parameters with File -

after numerous various tests uploading files throught http post request, looks http put requests suitable large files +1gb upload. the below listed simple code have tested http put file upload request works well: javascript: var req = createrequest(); req.open("put", "php/fileputload.php"); req.setrequestheader("content-type", "text/plain"); req.onload = function (event) { console.log(event.target.responsetext); } req.send(auploadedfile.file_object); php: include 'chromephp.php'; require_once 'mysqlconnect.php'; ini_set('max_execution_time', 0); chromephp::log( '$_put :' . print_r($_put)); /* put data comes in on stdin stream */ $putdata = fopen("php://input", "r"); /* open file writing */ $fp = fopen("myputfile.ext", "w"); /* read data 1 kb @ time , write file */ while ($data = fread($putdata, 1024)) fwrite($fp, $data); /* close streams */ fclose(...

arduino - ERROR: SIM900 doesn't answer. Check power and serial pins in GSM.cp -

iam using itead sim908 gsm/gps/gprs module arduino uno, iam trying send gps coordinates sms message , gprs internet server, cant run both same time, although it's work separately. when try send gps coordinates via sms message , send data via gprs server same time have error : error: sim900 doesn't answer. check power , serial pins in gsm.cpp this code, 1 have solution ? #include "sim900.h" #include #include "inetgsm.h" #include "sms.h" //#include "call.h" #include "gps.h" char smsbuffer2[150]; char id[]="12"; char httpbuffer[160]; inetgsm inet; //callgsm call; smsgsm sms; gpsgsm gps; char msg[50]; int numdata; char lon[15]; char lat[15]; char alt[15]; char time[20]; char vel[15]; char msg1[5]; char msg2[5]; char mobile[]="0595285486"; char stat; char inserial[50]; int i=0; boolean started=false; void setup(){ get_gps(); delay(1000); send_server(); delay(1000); send_sms(); } void loop(){ } vo...

php - Having max of column repeat for each row in mysql -

lets have table , a user count 4 b 1 c 3 d 2 i want write query returns each value of along max value of count,something user maxcount 4 b 4 c 4 d 4 the way trying achieve is, select user,max(count) maxcount the result : user maxcount 4 which not want. i understand write multiple queries(i.e. 'select user a' /'select max(count) a') may seem redundant , but think having way best me don't want call mysql multiple times , push returned data single jsonobj front end , easier have single table combing 2 returned-tables 1 , converting json this query give max value on rows: select user, (select max(count) yourtable) maxcount yourtable;

jquery - Using asp.net postback inside a php page -

i have php page (from wordpress) loads inside of asp.net page. the inside page have asp.net controls every time click auto-postback reloading entire page in totally messed url. i load asp.net using jquery's load() function , need trigger function inside of page. now, when press asp button page call postback function, new page read post value , execute needs executed. in case post message sent wordpress totally ignore it. need forward post data new page? or i'm in totally wrong way? i'd don't use iframes, there solution? i assume asp.net outside of wordpress framework. seems trying communicate wordpress functions using php. if case can enable wordpress frame work page out side of wordpress require_once( dirname( file ) . '/wp-load.php' ); doing include wordpress functions can utilize built in api.

java - Converting date.toString() to date -

i'm trying convert string date. i've got example here input string hardcoded string. try { string currentdate = "tue jan 05 21:19:57 cet 2016"; date d = new simpledateformat("eee mmm dd hh:mm:ss zzz yyyy", locale.us).parse(currentdate); } catch (parseexception e) { e.printstacktrace(); } for reason, throws following exception: parseexception: unparseable date: "tue jan 05 21:19:57 cet 2016" (at offset 20) could me problem? thanks! your problem described java.text.parseexception: unparseable date your machine local can effect local used in simpledateformat

xml - Create hyperlink with concat in XSLT --> HTML -

hi , happy year ! once again, need transformation in xslt. i have xml-tei file lot of pb elements. instance : <pb ed="bnf" id="f77.image.r"/> i have in same file 1 link element : <link id="bnf" target="http://test.com:/12148/btv1b90621925/"/> my transformation in xslt should not transform <pb> element in html : [77r] [77r] should hyperlink. now, first stuff : <xsl:template match="pb[@ed='bnf']"><span class="pb"> <xsl:text> [</xsl:text> <xsl:value-of select="substring-after(substring-before(@id, '.image.'), 'f')"/><xsl:value-of select="substring-after(@id, '.image.')"> </xsl:value-of> <xsl:text></xsl:text> <xsl:apply-templates/> <xsl:text>] </xsl:text> </span> </xsl:template> how can reach ...

I'm working on a Java Appet that fades an image then shows it again in a different spot in the applet window -

this question has answer here: how fade image in swing? 3 answers fade in , fade out effect in java applet 3 answers the applet working fine, in showing image , text, image fade reappear in spot, reload in same spot later. i fade , move test well, here's code far, forgive me i'm newbie! import java.applet.*; import java.awt.*; import java.awt.image.*; import java.net.*; public class fadeimage extends applet { image img, faded; int level, sign; mediatracker tracker; alphafilter f; filteredimagesource fis; string msg2 = "university of utah football"; public void init() { setbackground(color.red); setforeground(color.black); level = 0; sign = 15; tracker = new mediatracker(this); try { img = getimage(new url(getdocumentbase(), "...

laravel - Can't install laracasts/utilities through composer -

if have package list that: "require": { "laravel/framework": "4.2.*", "illuminate/support": "~5.0", "way/generators": "2.*", "intervention/image": "~2.1", "doctrine/inflector": "~1.0", "doctrine/dbal": "~2.3", "laracasts/utilities": "~2.0" }, or "illuminate/support": "~4.0" , error: - way/generators 2.6.1 requires illuminate/support ~4.0 -> no matching package found. - way/generators 2.6 requires illuminate/support ~4.1 -> no matching package found. - way/generators 2.5 requires illuminate/support ~4.1 -> no matching package found. ... , on so, if change package "illuminate/support": ">4" , this: - conclusion: don't install laravel/framework v4.2.18 - conclusion: remove laravel/framework v4.2.17 - conclusion: don't insta...

Google Plus Signin and Over-The-Air Install not working? -

i've managed build photohunt ( https://developers.google.com/+/web/signin/android-app-installs ) demo app did not manage sign-in display google play popup in order download android app. i've created api project, gave 2 client ids, 1 web app ( hosted here: http://getnowtesting.appspot.com/ ) , 1 android app ( got package name , certificate fingerprint. ) , signin has apppackagename attached. for more info, have app on play store, test account has device attached can run app, , app not installed on device. any ideas i'm doing wrong? feature working someone? thank you! the reason app has not yet exceeded google's quality threshold becoming available over-the-air installs. quality threshold not published, intended ensure quality apps have sufficient reviews, ratings, , installs able pushed devices. https://developers.google.com/+/features/play-installs edit: apps must free. in case, appears true.

mvvm - UWP ContentDialog Invocation -

i using uwp , template 10 build gui app following mvvm pattern. part of application need invoke content dialog pressing button on main page. separate contentdialog created in standalone .xaml file purpose: <contentdialog x:class="uwp1.views.speech" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:uwp1.views" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d" title="dictate" primarybuttontext="accept" secondarybuttontext="cancel" primarybuttonclick="contentdialog_primarybuttonclick" secondarybuttonclick="contentdialog_secondarybuttonclick" > <grid> <grid.rowdefinitions> <rowdefiniti...

xml - XSL-FO Render Has Region-Body at Top of Page. How do I fix? -

Image
i'm assuming region-body should take place after region-before, isn't case once i've transformed pdf. <fo:root> <fo:layout-master-set> <fo:simple-page-master master-name="simplea4" page-height="11in" page-width="8.5in" margin-left="0.5cm" margin-right="0.5cm"> <fo:region-body /> <fo:region-before region-name="xsl-region-before" extent="10mm"/> <fo:region-after region-name="xsl-region-after" extent="3cm"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="simplea4"> <fo:static-content flow-name="xsl-region-before"> <fo:block> header </fo:block> </fo:static-content> <fo:static-content flow-name...

javascript - Console will not wait for file load before printing -

i have file containing json data want read. found code reading file @ neontribe.co.uk, can't seem console wait load complete. function ondeviceready(){ window.resolvelocalfilesystemurl(cordova.file.externaldatadirectory, function(fs) { var directoryreader = fs.createreader(); directoryreader.readentries(function(entries) { var i; (i=0; i<entries.length; i++) { document.addeventlistener('deviceready', ondeviceready2, false); function ondeviceready2() { function readfromfile(filename) { var pathtofile = cordova.file.externaldatadirectory + filename; window.resolvelocalfilesystemurl(pathtofile, function (fileentry) { fileentry.file(function (file) { var reader = new filereader(); reader.onloadend = function (e) { console.log("inside load" + json.parse(this.result)); return json.parse(this.result); }; reader.readastext(fi...

mysql - Minus credit from debit column in same query? -

i have following query: select user_id, sum( credit ) cred, sum( debit ) deb account user_id = '35' i want minus debit credit , show in 1 column or value in variable you can calculate difference in same line select user_id, sum(credit) cred, sum(debit) deb, sum(credit) - sum(debit) total account user_id = 35 update 1 select user_id, sum(credit) cred, sum(debit) deb, sum(credit) - sum(debit) total account user_id in (30,31,32,33,34,35) group user_id update 2 select user_id, sum(credit) cred, sum(debit) deb, sum(credit) - sum(debit) total account user_id in (30,31,32,33,34,35) group user_id having (sum(credit) - sum(debit)) < 10

c# - What is the equivalent in VB.NET for a thread delagate? -

i trying convert c# code stack overflow question used in vb.net. using .net framework 4.0. wpf wait window here code: thread thread = new thread(() => { window1 w = new window1(); w.show(); w.closed += (sender2, e2) => w.dispatcher.invokeshutdown(); system.windows.threading.dispatcher.run(); }); thread.setapartmentstate(apartmentstate.sta); thread.start(); dim thread new thread(sub() dim w new window1() w.show() addhandler w.closed, sub(sender2, e2) w.dispatcher.invokeshutdown() system.windows.threading.dispatcher.run() end sub) thread.setapartmentstate(apartmentstate.sta) thread.start()

named fifo C issue -

i have c code: #define bufsize 256 int main ( int argc, char *argv[]) { int fdin; int fdout; if( argc != 3) { perror("argument error"); exit(1); } if( (fdin = open(argv[1], o_rdonly ) )<0) { perror("pipe input error open"); exit(1); } if( (fdout = open(argv[2], o_wronly ) )<0) { perror("pipe input error open"); exit(1); } int c = 2; while(c--) { char var1[bufsize]; char var2[bufsize]; char string[100]; memset(var1, 0, sizeof(var1)); memset(var2, 0, sizeof(var2)); memset(string, 0, sizeof(string)); if( readline(fdin, var1, sizeof(var1)) == 0) { printf("exit1\n"); exit(0); } if( readline(fdin, var2, sizeof(var2)) == 0) { printf("exit2\n"); exit(0); } removenewline(v...

(SAS 9.4) Is any functions in SAS which can extract residual from regression equation? -

i need know function can extract residual regression equation. i need function make 2-stage credit model. want extract residual first stage model(regression) , apply residual second stage model(y value). it helpful if there proper function in sas 9.4. thank you look @ documentation around proc reg. proc reg data=indata; model y = x1 x2 x3; output out=oudata r=resid; run; quit; this takes data indata data set, regresses y on x1, x2, , x3, , outputs residuals in outdata.

c++ - QSound Unexpected null receiver while playing .wav files -

i play .wav samples of engine through out qt creator. of course first thought on qsound class, did whatever necessary play , shows me qcoreapplication::postevent: unexpected null receiver which means entered wrong path file, seems simple have tried absoulte paths , etc. nothing new has happened. sourcecode , photos, trying on windows run on raspberry(fedora). #include <qcoreapplication> #include <qsound> #include <iostream> #include <qmediaplayer> int main(int argc, char *argv[]) { qcoreapplication a(argc, argv); qsound let("music/letitplay.wav"); let.play(); /*qmediaplayer * music = new qmediaplayer(); music->setmedia(qurl("qrc:/sounds/letitplay.wav")); music->play(); */ return 0; } snippet .pro qt += core qt -= gui qt += multimedia target = silnik1 config += console config -= app_bundle template = app sources += main.cpp resources += screen of path , file directory qsound plays sounds asynchronous...

functional programming - Manipulating java objects from clojure -

am new @ clojure , interact java objects using clojure. if have understood, 1 can reach interaction using defprotocol . concretely try following: 1- have following java class package mytestspackage; public class testobject { private string lastname; private string firstname; private string age; public testobject(string lastname, string firstname, string age) { super(); this.lastname = lastname; this.firstname = firstname; this.age = age; } public string getname() { return this.lastname; } public void setname(string name) { this.lastname = name; } public string getfirstname() { return this.firstname; } public void setfirstname(string vorname) { this.firstname = vorname; } public string getage() { return this.age; } public void setage(string age) { this.age = age; } } 2- create clojure protocol should allow me access inst...

windows - Embed a .exe file into a .bat file and auto copy to a desired location -

i using curl.exe file in batch file problem users should not know mechanism using pull , display data website. now how working: have place curl.exe file under c:\ batch file use connect wan server , pull data. what expecting: need merge / attach curl.exe batch file user don't have copy curl file c:\ location batch execute. finally converting batch file exe, there way can merge curl.exe , my.bat file , copy curl.exe desired location? many thanks... you can following (based on answer here ): create 1 file batchbin.bat following contents: ;;;===,,,@echo off ;;;===,,,echo here ;;;===,,,findstr /v "^;;;===,,," "%~f0" > curlextracted.exe ;;;===,,,echo can add code here ;;;===,,,curlextracted.exe example.com ;;;===,,,echo can add code until here ;;;===,,,exit /b very important: after exit /b press enter in order create newline otherwise won't quite work. then run following command (assuming have curl.exe , batchbin.exe in current w...

How to set From header to User email on Amazon SES? -

i'm using amazon ses send emails webapp. let's user user1@email.com performs action sends email user2@email.com . user2@email.com has auto-reply says he's out of office, , emails should forwarded instead user3@email.com. emails webapp sent no-reply@webapp.com via ses (and had verify own email.) when sending email user1@email.com -> user2@email.com , set header no-reply@webapp.com reply-to header set user1@email.com , in case further communication between these users needed. works if hit "reply" button on email, , instead of sending no-reply, email goes user1. good! however...it seems auto-reply functions in vast majority of mail clients ignore reply-to field , send auto-reply email email in "from" header. so question is: how "fake" header can make it's coming user1@email.com auto-reply messages delivered appropriate email? thanks! first of all, doesn't looks it's idea make reply available noreply a...

php - How to route all url with same prefix to one action -

i want route url same prefix same action like: http://host/pic/with/bird http://host/pic/with/bird/with/fish http://host/pic/with/pig/theme/sad/resolution/high all piccontroller@showpic i tried write route route::get("/pic/*","piccontroller@showpic"); to route url start /pic/ same function. route * not work. if take @ illuminate\routing\route , has method called where() this. comment on method says "set regular expression requirement on route." that this: route::get('/pic/{section}', 'piccontroller@showpic')->where(['section' => '.*']); essentially meaning take after /pic/ part , pass variable showpic() method. now, parsing on method should easy simple explode() on forward slash assuming have sort of pattern or trying each of values.

c# - ReflectedType of MemberExpression is the base class rather than actual class used -

so have following classes class person { virtual string property{get;set;} } and class manager : person { [someattribute("hello")] override string property {get;set;} } if have member expression on type manager, ie: property prop = propertygetter.getprop<manager>(p => p.property) then reflectedtype of memberexpression person , rather manager . means attribute information lost. so: var attribute = prop.getattribute<someattribute>(); then attribute null. i'm assuming because property base class, not defined in manager, how can around this? the issue fixed if use new keyword on property rather virtual , override . i think has fact there no instance of type manager . another way fix change implementation of getprop return typeof(t).getproperty(property.name) rather returning property

Clone checked checkbox label and append to closest div with jquery -

i'm trying create search filter displays list of values user has checked in div. want cloning checkbox's label. so when user clicks checkbox in 1 of these fieldsets, should clone , append label "list" div below. here's html: <div class="filters"> <h2>narrow by:</h2> <fieldset> <legend>product</legend> <p> <label for="one">filter 1 label</label> <input type="checkbox" id="one"> </p> <p> <label for="two">filter 2 label</label> <input type="checkbox" id="two"> </p> <p> <label for="three">filter 3 label</label> <input type="checkbox" id="three"> </p> </fieldset> <div class="list"> </div> <fieldset> <legend>product version</legend> <p> <label for="four">filte...

java - How to share the NavigationView between activities in Android (SDK21+) -

so, have class, homeactivity.class: import android.content.intent; import android.os.bundle; import android.support.design.widget.navigationview; import android.support.v4.view.gravitycompat; import android.support.v4.widget.drawerlayout; import android.support.v7.app.actionbardrawertoggle; import android.support.v7.app.appcompatactivity; import android.support.v7.widget.toolbar; import android.view.menu; import android.view.menuitem; public class homeactivity extends appcompatactivity implements navigationview.onnavigationitemselectedlistener { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_drawer); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); /* todo: relocate button appear in each individual place floatingactionbutton fab = (floatingactionbutton) findviewbyid(r.id.new_ticket); fab.setonclicklistener(new view.onclicklis...

ember.js - Ember Component classNameBinding not binding -

i have component button needs change it's classnames via property of parent component/controller: // components/my-button/component.js import ember 'ember'; export default ember.component.extend({ tagname: 'button', classnamebindings: ['classnames'], // other unrelated stuff following.... }); it's template: // components/my-button/template.hbs {{text}} // nothing important here exept test-output of: {{classnames}} and insert in component: // component/parent-component/template.hbs {{my-button classnames=variableclassnames text='foo' }} // components/parent-component/component.js import ember 'ember'; export default ember.component.extend({ issortabledown: ember.computed('track.sort', 'maxsort', function() { return this.get('track.sort')<this.get('maxsort'); }), variableclassnames: ember.computed('issortabledown',function() { ...

How to send 802.15.4 packets using XBee S2? -

i did quick search not find answers wanted. i have been playing around 2 xbee s2 modules , both configured api mode 2. have tried sending , receiving zigbee packets using xctu without problems. when try send 802.15.4 packets using xctu, other xbee not seem receive it. suppose or suppose configure something? thanks.

swift - Pinterest IOS SDK getBoardPins response Code=-1011 "Request failed: bad request (400)" -

i'm getting bad request return on pdkclient.sharedinstance().getboardpins(boardid, fields: ["image", "description"], withsuccess: { (responseobject :pdkresponseobject!) -> void in print(responseobject.pins().first!.descriptiontext) }) { (err :nserror!) -> void in print("error nserror: \(err)") } passing boardid from: override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { if let dvc = segue.destinationviewcontroller as? pincollectionviewcontroller { dvc.boardid = selectedboard.identifier } and can't figure out why? know board id correct , tried hard coding it. i've been authenticated... from sdk: /** * list of pins given board. response can used * bext page of pins. * * @param boardid id of board * @param fields pin fields returned api * @param successblock called when api call succeeds * @param failure...

ios - Issues with constraints -

Image
so have 5 views - v1, v2, v3, v4 , v5 these views added view acts contained view can scroll between them - page controller. embedded in navigation controller the issue when set constrain v2-v5 not work unless hit home button come back. does know why happening? before after click home button , come view

Find an element in a List by comparing with another list in scala -

i have 2 list. val lis1= list("pt1","pt2","") val lis2= list("pt1","") i need find empty string in lis1 trying val find= lis1.find(lis=>lis2.contains("")) here instead returning me "" , returning me ("pt1"). kindly me how can empty string instead of "pt1" it sounds want intersection of 2 lists. can use filter + contains , similar original approach. alternative can use intersect method. val lis1 = list("pt1", "pt2", "") val lis2 = list("pt1", "") lis1.filter(item => lis2.contains(item)) // > res0: list[string] = list(pt1, "") lis1.intersect(lis2) // > res1: list[string] = list(pt1, "")

clojure - Is there an if-clojurescript macro? -

is there macro clojure , clojurescript allow insert different expressions depending on whether file being compiled in clojure or clojurescript? (if-clojurescript (my clojurescript definition) (my clojure definition)) essentially i'm looking #ifdef some_platform macros might see sprinkled around c++ code. think useful files part of cross-over, 1 small part of file isn't compatible between clojure/clojure-script. this new feature clojure 1.7 : reader conditionals . also see daniel compton blog , example : #?(:clj (clojure expression) :cljs (clojurescript expression) :clr (clojure clr expression)) you may want @ macrovitch .

r - How to display date in month and year format -

i have date field called date.timestamp in database,which has date values "fri nov 27 20:17:01 ist 2015" .there lot of records having date.timestamp field. need display nov 2015 records in database. how can that? assuming ist indian standard time, 5:30 hours ahead of coordinated universal time, 1 substitute ist +0530 , use format %z of strptime . vec <- "fri nov 27 20:17:01 ist 2015" format(strptime(sub("ist", "+0530", vec), "%a %b %d %h:%m:%s %z %y"), "%b %y") # [1] "nov 2015" vec <- c("fri nov 27 20:17:01 ist 2015","mon nov 30 20:17:01 ist 2015") format(strptime(sub("ist", "+0530", vec), "%a %b %d %h:%m:%s %z %y"), "%b %y") # [1] "nov 2015" "nov 2015"

objective c - Add Search to tvOS UITableView -

i have tableview on 400 objects on tvos app, , needs have search functionality on it. after reading through sample code apple, here have. secondviewcontroller main tableview is, while kept name of resultsviewcontroller same apple had it. in main 1 have: -(void)viewdidload { [super viewdidload]; _resultstablecontroller = [[aplresultstablecontroller alloc] init]; _searchcontroller = [[uisearchcontroller alloc] initwithsearchresultscontroller:self.resultstablecontroller]; self.searchcontroller.searchresultsupdater = self; [self.searchcontroller.searchbar sizetofit]; self.tableview.tableheaderview = self.searchcontroller.searchbar; // want delegate our filtered table didselectrowatindexpath called both tables self.resultstablecontroller.tableview.delegate = self; self.searchcontroller.delegate = self; self.searchcontroller.searchbar.delegate = self; // can monitor text changes + others // search presenting view controller. such, norm...

oop - How do I extend (with a new name) a static function in javascript without affecting the original? -

i'm having trouble working out how extend static function (momentjs) can override methods, without altering original function. to clear know how extend instance of moment override functions, want extend library directly own named instance of moment can use in same way momentjs. as example, i'd able following extendedmoment().customfunction() //do custom extendedmoment().tostring() //use customised tostring() method extendedmoment().format() //use original momentjs method i've tried few options copying prototype etc, editing prototype of new extendedmoment function seems affect original. update : answered below @patrickroberts after digging the source , can't directly extend library because there several scoped functions not exposed, , moment() wrapper of wrapper of wrapper of wrapper of constructor . here's best can reusing same extended prototype rather assigning scoped functions inside factory extension: function extendedmoment...

installation - How to do a dynamic password in Inno Setup? -

i want know how can create password rotate in inno setup? similar "token"? or search in sharepoint list? don't want same. is possible? do have other suggestion? thanks advance! use checkpassword event function instead of password directive . [code] { passwords cache in case retrieval time consuming } var passwords: array of string; function checkpassword(password: string): boolean; var index: integer; sha1: string; begin { checkpassword may called before other code (including initializesetup), } { initialization has happen in function itself. } if getarraylength(passwords) = 0 begin log('initializing hashes'); setarraylength(passwords, 5); passwords[0] := 'df65784979efcda967c88de7098a5a106101064e'; passwords[1] := 'b78baf5db4b1498ed075b8e6accd0b5ff51e20ec'; passwords[2] := 'aaf70585b9a2662c911392b7573c739cecea0e56'; passwords[3] := '3ab4222e2d0000012e6c7381437178fab398e8...

asp.net mvc - ASP net MVC: How to ignore one get variable with route? -

i have url: http://url.com/segment1?id=885&variable_need_to_ignore=value i need exclude last variable ( &variable_need_to_ignore=value ) url , process without variable (ideally without redirect, on same page) http://url.com/segment1?id=885 (with route config ideally). you change query string parameters url path parameters. check out this . imho make urls cleaner , follow more of restful paradigm. if not creating route " http://url.com/segment1 " , ignore query string parameter "variable_need_to_ignore" inside code. it still leaves questions: why need ignore , why in url in first place if not in need of it? edited if incoming parameters out of control , need ignore them, ignore them in code. since resource exists @ url provide, imho, 404 isn't valid response in situation. query string should used kind of filter on results return, should not required parameters in first place.

c# - Multiple custom micro sites, how to shut them down during maintenance? -

i have multiple smallish micro-sites custom built, none of them built on common codebase (legacy). during maintenance, when need bring these sites down manually process setting custom page redirects when things getting updated during downtime. i want build common library can drop each site control things @ global level switch sites on/off. what suggest do this? i place file in root folder(wwwroot?) these sites can before serving information. file contain simple flag indicates if information should served, , possibly url should redirect user when sites down. all of assumes able modify projects utilize file of course.

recursion - JavaScript Recursive Delayed Method call -

this question has answer here: calling functions settimeout() 5 answers i wanted write simple function updated paragraph element <p></p> every second new text in pattern, unsure how go delaying method call solution tried doesn't seem work. if remove settimeout method , replace simple recursive call function prints out pattern supposed doesn't print out delay want. function printpattern(eventsource, width, height, counter){ if(height == 1 && counter >= width) { return; } else{ if(counter >= width){ eventsource.innerhtml += "<br>"; //printpattern(eventsource,width,height-1,0); settimeout(printpattern(eventsource,width,height-1,0), 1000) } else{ if((counter%2 == 0) ^ (height%2 == 1)){ eventsource.innerhtml += ...