Posts

Showing posts from June, 2013

html5 - Hover effect with anchor tag on image not working -

i want this effect image. i implemented have anchor @ place of figure , when hover on image should able click on , should redirect. achieve it? i use following code hover effect: .tint { position: relative; float: left; margin-right: 20px; margin-bottom: 20px; cursor: pointer; box-shadow: rgba(0,0,0,.2) 3px 5px 5px; } .tint:before { content: ""; display: block; top: 0; bottom: 0; left: 0; right: 0; background: none; transition: .3s linear; } .tint:hover:before { background: rgba(0,0,255, 0.5); } if remove position:absolute , link starts working hover effect gone. please me if has solution this. thanks in advance. you can try meanings of code: <div> <img src="https://www.nasa.gov/sites/default/files/styles/image_card_4x3_ratio/public/thumbnails/image/leisa_christmas_false_color.png?itok=jxf0ils4"> <div class="mask"> </div> </div> <style> .mask { position: ab

java - Programtically bypass "touch to configure" Android Widget -

i know how bypass "touch configure" on android widget programmatically. once have installed android widget on device says "touch configure" executes class "intelligenwidgetconfig.java" . want automatically happen on start of application. can advise me on how approach method or solution might help? android config class: public class intelligenwidgetconfig extends activity { private static final string tag = "intelligenwidgetconfig"; public intelligenwidgetconfig() { super(); } public static int getappwidgetid(context context) { sharedpreferences settings = context.getsharedpreferences("intelligen", mode_private); return settings.getint("appwidgetid", 1); } protected void setappwidgetid(int id) { sharedpreferences settings = getsharedpreferences("intelligen", mode_private); sharedpreferences.editor editor = settings.edit(); editor.putint

opengraph - Linking to unity mobile app from facebook open graph post -

at moment, if clicks on open graph post made app, goes url of object. send user ios or android app depending on platform see open graph post. app not have canvas version. looked applinks can't seem find documentation on end end example unity. there way reliably redirect user app open graph post?

javascript - Gulp doesnt watch for any SCSS changes. Do I have to use gulp-ruby-sass? -

i have gulp file set watch changes. i'm developing application in reactjs using redux architecture. i've noticed gulp not watch changes in scss files. /*eslint-disable */ var path = require('path'); var runsequence = require('run-sequence'); var install = require('gulp-install'); var spawn = require('child_process').spawn; var $ = require('gulp-load-plugins')({ pattern: [ 'gulp', 'gulp-*', 'gulp.*', 'merge-stream', 'del', 'browserify', 'watchify', 'vinyl-source-stream', 'vinyl-transform', 'vinyl-buffer', 'glob', 'lodash', 'less-plugin-*', 'mochify' ], replacestring: /^gulp(-|\.)/, rename: { 'merge-stream': 'mergestream', 'del': &

c++ - Adding null character after string computation -

i trying print string "ans" directly using cout << ans; instead of going through loop on each character of string. here complete code have written (string ans , s have same size). ps: program takes string , print corresponding number associated character of mobile keypad.(like b c give 2, d e f give 3) (so string abcdef print 222333 why string ans , s have same size) ps: have written in comments problem is. #include<iostream> char has[]={'2','2','2','3','3','3','4','4','4','5','5','5','6','6','6','7','7','7','7','8','8','8','9','9','9','9'}; using namespace std; int main() { //code int t; cin>>t; while(t) { string s,ans; int i; cin>>s; fo

javascript - AngulaJS no output -

i've started learning angularjs using tutorials on youtube. in tutorial there's code when coded , browser won't show properties. can me solve ? this index.html <!doctype html> <html ng-app = "mymodule"> <head> <meta charset="utf-8"/> <title> </title> <script src="angular/angular.min.js"></script> <script src="script.js"></script> </head> <body> <div ng-controller="mycontroller"> <div> first name : {{ employee.firstname }} </div> <div> last name : {{ employee.lastname }} </div> <div> age : {{ employee.age }} </div> <!-- <div> {{message}} </div> --> </div> </body> </html> and script.js file var myapp = angular.module("mymodu

Maven archetype - optional property, empty by default -

i want able generate project archetype one of properties being empty default , or populated if specified on command line. this archetype-metadata.xml : <?xml version="1.0" encoding="utf-8"?> <archetype-descriptor name="basic"> <requiredproperties> <requiredproperty key="compilerversion"/> <requiredproperty key="dependencyclassifier"> <defaultvalue></defaultvalue> </requiredproperty> </requiredproperties> </archetype-descriptor> this not working. if there non-whitespace value in dependencyclassifier , works flawlessly. however, cannot work default value being "empty". the error when defaultvalue empty/null is: [error] failed execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate (default-cli) on project standalone-pom: archetype com.avast.archetype:compile-java:1.0.21 not configured [error] p

c# - @Html.EditorFor sends wrong value to the controller -

Image
i created @html.editorfor icollection list looks this. public virtual icollection<descriptionparameters> descriptionparameters { get; set; } class descriptionparameters shown below. public partial class descriptionparameters { public int id { get; set; } [required (errormessage = "please enter description")] public string description { get; set; } [required(errormessage = "please enter description parameter")] public string descriptionparameter { get; set; } public int product_id { get; set; } public virtual product productset { get; set; } } i created @html.editorfor(x => x.descriptionparameters,new {id="descripteditor" }) inside html form . editor created editorfortemplate. @model onlineshop.models.descriptionparameters <script src="~/scripts/discriptionparameters.js" type="text/javascript"></script> <table> <tr&

c++ - Is it possible to force `round` to be in namespace std? -

i need declare own function double round(double,double) extern "c" , conflicts double round(double) declared in <bits/mathcalls.h> (gcc 5.4.0). , because include <cstdint> . there preprocessor variable _glibcpp_use_namespaces, seems enforce namespace std around round , defining yields error /usr/include/c++/5/cwchar:141:11: error: ‘::btowc’ has not been declared when <map> included, need later on. is there other way? it looks there no official way prevent round in global namespace , existence of _glibcpp_use_namespaces in gcc's implementation of standard library indicates such possibility indeed, not find documentation preprocessor variable , if possible in older version broken.

linux - adb hangs when running scripts in debian chroot on android -

i'm trying run scripts under testing binaries compiled arm-android. achieve have debian in chroot, bash script computer, android shell , chrooted debian itself. problem after running twice, adb hangs , looks way fix reboot device. hanging mean running adb shell, adb push or has no effect, adb not responding. also, if keep adb shell open when hangs, though cannot connect new shell tablet, old connection still works. observed services on android being killed when adb stops responding. idea may cause , how can debug it? script running on computer: adb shell "mount -o remount,rw /" printf "pushing android.sh device... " adb push android.sh / adb shell "chmod 777 android.sh" printf "pushing debian.sh device... " adb push debian.sh /data/local/debian/ adb shell "chmod 777 /data/local/debian/debian.sh" adb shell ./android.sh printf "fetching results device... " adb pull /data/result.log cat result.log android.sh :

php - Redirect everything to specific page, except for some URLs - Yii -

in web app, need redirect all urls specific page, exception of 3 specific urls. how can globally (and painlessly) in yii framework? there base controller can use handle requests? i'm using yii 2.0. i use or similar urlmanager configuration: 'urlmanager' => [ 'enableprettyurl' => true, 'rules' => [ // rule specific url #1, // rule specific url #2, // rule specific url #3, '<controler>/<action>' => 'redirect/target', ], ] this way not matched first 3 rules matched last 1 , goes 'redirect/target' .

Scala file cannot be edited in Scala-IDE -

Image
i trying implement micro-service in scala , decided use scala-ide editor advised. s.o ubuntu 14.04 64, , using java 1.7 , scala-ide version downloaded here . created project using this tutorial , can't edit within scala editor file created (like there lock on file itself). please notice project has scala nature. please advise how solve issue.

arguments - Cannot find missing ) in my code that shows in Chrome Console -

testing youtube popup <html> <head> <script type="text/javascript"> function goclicky(meh) { var x = screen.width/2 - 700/2; var y = screen.height/2 - 450/2; window.open(meh.href, 'sharegplus''height=640,width=800,left='+x+',top='+y, 'toolbar=no' 'menubar=no'); } </script> </head> <body> <a href="https://www.youtube.com/embed/q96wht9s_1m" onclick="goclicky(this); return false;" target="_blank">check out new video blind!</a> </body> </html> the chrome console shows "uncaught syntax error: missing ) after argument list. i know chrome incredibly forgiving no0b i'd know is. first try @ new popup. you're missing couple commas in window.open() . should read: window.open(meh.href, 'sharegplus', 'height=640,width=800,left='+x+',top='+y, 'toolbar=no', 'menubar=no');

javascript - Jquery to change CSS background: Checking to see if div contains text, then action -

i trying css background based on weathertype. if($('#weathertype:contains("cloudy")')) { $('body').css('background-image', 'url(https://hd.unsplash.com/photo-1430263326118-b75aa0da770b)'); } else if($('#weathertype:contains("clear sky")')) { $('body').css('background-image', 'url(https://media.giphy.com/media/3o7rc6sa2rvko8k5ei/giphy.gif)') }; html <body> <div class="text-center"> <h1> show local weather</h1> <h3>front end developer project</h3> <ul class="list-unstyled"> <i class="fa fa-home" aria-hidden="true"></i> <li class="btn btn-default" id="city"></li> <i class="wi wi-day-cloudy"></i> <li class="btn btn-default" id="weathertype"></li> </br> <i class="wi wi-thermometer">

sql server - Top 12 from union queries filtering max 12 rows Ms Sql -

i facing issue, need 12 max rows 3 tables union data. if of table not have fixed rows other table should considered remaining rows. for example: have 3 tables product category manufacturer case 1 : if have 10 rows each should select 4 rows each table. case 2: if product table have 3 rows , category manufacturer have 5 rows each, should select 3 product , 5 category or manufacturer each. case 3: have less 4 rows shows many rows available. please me acheive this. posting stored procedure have created till now. create procedure [dbo].[getrowsfromtables] @searchterms nvarchar(150) begin create table #search (id int identity ,ids int, productname nvarchar(200), categoryname nvarchar(200), tagname nvarchar(200), sename nvarchar(200), displayorder int) insert #search select top 12 p.id ids, p.name productname, '' categoryname, '' tagname, '' sename, 0 displayorder product p p.published = 1 , p.deleted = 0 , name '%' + @searchterms + &#

rust - How do I implement commutative (scalar) multiplication with a built-in type like `f64`? -

i'd implement commutative scalar f64 multiplication operation using * operator. implementing mul<f64> trait type gives me right side multiplication like. struct foo(f64); impl mul<f64> foo { type output = foo; fn mul(self, _rhs: f64) -> foo { // implementation } } let = foo(1.23); * 3.45; // works 3.45 * a; // error: trait bound `{float}: std::ops::mul<foo>` not satisfied [e0277] for non-builtin scalar type, can implement same trait other way round on scalar, i.e. implementing mul<foo> on scalar type. how left side implementation built-in type f64 too? you can reverse implementation, swapping f64 foo impl std::ops::mul<foo> f64 { type output = foo; fn mul(self, rhs: foo) -> foo { rhs * self } } try out in playground

color row tableview not change javafx -

i have tableview text message change color in term of type message. have following code : tableviewerreur.setrowfactory(param -> new tablerow<boerreur>() { @override protected void updateitem(boerreur paramt, boolean empty) { super.updateitem(paramt, empty); if (!isempty() && paramt != null) { switch (paramt.getniveauerreur()) { case 0: setid(constantsui.css_erreur_info); break; case 1: setid(constantsui.css_erreur); break; default: break; } tableviewerreur.refresh(); } } }); and have following code have wrap text in cell : tablecolumnerreur.setcellfactory(new callback<tablecolumn<boerreur, string>, tablecell<boerreur, string>>() { @override public tablecell<boerreur

eclipse - Getting an error in Mule Debug perspective in AnypointStudio -

i getting following error when choose debug project in anypoint studio: plug-in "org.mule.tooling.ui.contribution.munit" unable instantiate class "org.mule.tooling.ui.contribution.munit.runner.report.testrunnerviewpart" the full error see in muint tab: org.eclipse.core.runtime.coreexception: plug-in "org.mule.tooling.ui.contribution.munit" unable instantiate class "org.mule.tooling.ui.contribution.munit.runner.report.testrunnerviewpart". @ org.eclipse.core.internal.registry.osgi.registrystrategyosgi.throwexception(registrystrategyosgi.java:194) @ org.eclipse.core.internal.registry.osgi.registrystrategyosgi.createexecutableextension(registrystrategyosgi.java:188) @ org.eclipse.core.internal.registry.extensionregistry.createexecutableextension(extensionregistry.java:905) @ org.eclipse.core.internal.registry.configurationelement.createexecutableextension(configurationelement.java:243) @ org.eclipse.core.internal.registry.

iOS Core Data - Double to Decimal Migration Issue -

i have gone through data model , have converted number of properties double decimal. trying default migration process, , continue error: "can't find mapping model migration". i have used mapping models in past, , been able lightweight migration using them, have typically had structure changes. this first time, doing conversion of 1 type: nsnumber type: nsdecimalnumber. reading docs, seems need use subclasses of nsentitymigrationpolicy, have created. still getting same error not finding mapping model. are there gotchas i'm not seeing keeping column name same, , changing type of value prevents mapping model getting found?

c# - How to get controls inside Pivot.ItemTemplate in Pivot in UWP? -

i have following code: <scrollviewer x:name="swipebetweenpages" grid.row="1"> <pivot datacontext="{staticresource viewmodel}" x:name="pivot" margin="0,-45,0,0" headertemplate="{staticresource headertest}" itemtemplate="{staticresource pivottemplate}" itemssource="{binding articles}" selectionchanged="pivot_selectionchanged"> </pivot> </scrollviewer> <page.resources> <viewmodels:articleviewmodel x:key="viewmodel" /> <datatemplate x:key="headertest"> </datatemplate> <datatemplate x:key="pivottemplate"> <stackpanel margin="-15 0 -15 0"> <grid> <grid.background>

javascript - bootstrap dropdown on mouse over the menu item should show edit/delete icon on right side -

how include edit,delete icon in bootstrap menu item on mouse over. , while click on edit/delete icon, should call edit/delete method respectively. need achieve in below bootstrap dropdown, <div class="dropdown"> <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">dropdown example <span class="caret"></span></button> <ul class="dropdown-menu"> <li><a href="#">html</a></li> <li><a href="#">css</a></li> <li><a href="#">javascript</a></li> </ul> </div> on mouse on html/css/javascript menu item should display 'edit/delete' icon nearby. i have done css there several many ways. can call edit or delete functions adding click event on <i> tag appropriate classname. ul>li>a:h

android - How to stop an RxJava observable from emitting items. Tried to unsubscribe but it kept going -

in code create observable , keep reference subscription object. when start app prints numbers 1 1000000 if minimize activity, ubsubscribe subscription in onpause however, logcat keeps printing numbers. how stop doing so? public class mainactivity extends appcompatactivity { private subscription printingnumbers; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); printingnumbers = observable .range(1, 500000) .map(i -> i*2) .subscribe(i -> system.out.println(i)); } @override protected void onpause() { super.onpause(); printingnumbers.unsubscribe(); } } range returns values @ once takes time on log visualize it. interval return values @ given time, way can test unsubscribe. ps: think can combine range , interval emiits value limit

javascript - ES6 block scoping with in switch -

in es6, can achieve block scoping per case: switch(somvar){ case 'first': { let itemid='foo'; } break; case 'second': { let itemid='bar'; } } obviously, itemid might declared on top. use case, locally scoped variables make more sense because in overall code, more identifiable what's happening, , there number of case 's, whereas blocks contain variable in question , others don't. i have't seen block scoping used switch/case common usage. question simply, whether there reasons not it, stylistic-wise or else. edit, updated example code avoid confusion: const somefunc(action) => { switch(action.type){ case 'first': { let itemid=action.someobj.someprop.id; //do itemid } break; case 'second': { let itemid=action.someobj.someprop.id; //do itemid

Merging in r without writing multiple merge statements -

i have 1 data set base & there 7 other datasets 7 different years & 3 different regions .these datasets include amount,region & year common base data. however, need merge 7 data sets 1 one base dataset.how achieve that? base dataset: company_region raised_amount_usd year sf bay area 1000050 2011 sf bay area 2520000 2011 sf bay area 15000 2010 singapore 615000 2011 for year 2007: raised_amount_usd z e year company_region 1.00e+06 5 0 2007 singapore 8.00e+06 6 1 2007 singapore 50000 3 0 2007 singapore 35000 3 0 2007 singapore & have data other years 2008-2012.i need columns z & e in base data set.instead of writing 7 merge statements how can done through function? would great if can out.thanks in advance!! if want keep columns z , e, bind_rows() dplyr package seems answer (see here combine 2 data frames rows (rbind) when have different sets of

java - How to ignore "null" or empty properties in json, globally, using Spring configuration -

i'm trying return properties have values, null ones being returned. i know there's annotation ( @jsoninclude(include.non_null) ), need these in every single entity class. so, question is: there way configure globally through spring config? (avoiding xml, preferably) edit: seems question has been considered duplicate, don't think so. real question here how configure through spring config, couldn't find in other questions. if using spring boot, easy as: spring.jackson.serialization-inclusion=non_null if not, can configure objectmapper in mappingjackson2httpmessageconverter so: @configuration class webmvcconfiguration extends webmvcconfigurationsupport { @override protected void extendmessageconverters(list<httpmessageconverter<?>> converters) { for(httpmessageconverter converter: converters) { if(converter instanceof mappingjackson2httpmessageconverter) { objectmapper mapper = ((mappingjacks

Ordering of values in couchdb reduce -

are values in couchdb reduce function passed in order according keys argument? i mean of course when rereduce argument set false. yes, keys , values should have 1:1 mapping, , in same order. it's not explicitly stated in documentation , contextually that's gather.

string - What Plugins of wordpress use this site? -

i'm new here hello , want ask plugins of wordpress use site random string after slash url /? site : http://freaktoday.us/ after refresh http://freaktoday.us/ ?tem=832 change , every refresh random text changed how created thanks. this site may using plugin in wp hashed ids based on hashids library . also, wordpress has built-in function wp_unique_post_slug() and can referenced in wordpress codex .

php - include_once works in one page but not other, no errors with displaying_error on -

edit : i'm using bootstrap edit : when include bottom , footer in actualites.php ( end of file ) works. i bulding website , want include content url. have : <?php // menu include_once "menu.php"; // content include_once "contenu.php"; // bottom include_once "bottom.php"; // footer include_once "footer.php"; ?> when access url domain-name/apropos , bottom.php , footer.php appears.but access domain-name/actualites, bottom , footer doesn't appears. here content of error log file : [mon aug 08 14:44:55.832020 2016] [core:warn] [pid 7276:tid 340] ah00098: pid file d:/uwamp/bin/apache/logs/httpd.pid overwritten -- unclean shutdown of previous apache run? [mon aug 08 14:44:56.081628 2016] [ssl:warn] [pid 7276:tid 340] ah01873: init: session cache not configured [hint: sslsessioncache] [mon aug 08 14:44:56.097228 2016] [mpm_winnt:notice] [pid 7276:tid 340] ah00455: apache/2.4.10 (win32) openssl/1.0.1h php/5.4

google maps - How do I check if my domain is grandfathered? -

i have thoroughly read through updated google api terms , conditions: https://developers.google.com/maps/pricing-and-plans/standard-plan-2016-update specifically, excerpt: active domains created before june 22, 2016, continue able access google maps javascript api, static maps api, , street view image api without api key. not affected keyless access being unavailable new domains. my question is, how figure out if domain grandfathered , can continue call static maps api without api_key parameter? you can test if domain whitelisted trying load map without api key. if manage static map image means whitelisted. the whitelist has 25000 queries per day limit equivalent free quota limit when using key. to able monitor usage and, if needed, more quota best start using api key. can check quota , monitor usage in google developer console

etl - Unable to export data to PostgreSQL from Oracle -

Image
i have extract data oracle tables , copy them postgresql. able map both input , output files. on running connector component proper row fetching graphical image, when go table there no such data. this 1 postgresql postgresql: trace_debug result after trace debug get are trying read , write on same table in input , output ? (this problem). what kind of action using in output , insert, update, insert or update ? did check if there lock on output table ?

javascript - REST API basic authentication of third party -

i use teamwork project management tool. trying create web app using rest api given teamwork. requires authentication. have read teamwork documentation , have said authentication authentication managed using http authentication (only "basic" supported right now). every request must include authorization http header. use api token username, , "x" (or otherwise bogus text) password (only api token used authenticating api requests). example curl: curl -h 'accept: application/json' -h 'content-type: application/json' \ -u apikey0123456789:xxx -d '{"request": {"name": "some value"}}' https://yours.teamwork.com i looked online tutorial , wrote following code public function portallogin() { //curl // phpinfo(); //curl enabled $channel = curl_init(); //options curl_setopt($channel, curlopt_url, "http://projects.abounde.com/projects.json?status=late"); curl_setopt($

dev c++ - Dev C++ program closes immediately when entering letters -

my program closes when enter letter. shows rest of code not enter other parts of it. program closes when entering letters remains when entering numbers, until part program supposed show copied information. have tried putting getchar(); after every cin<<a; skips lines , enter few info. here code: * extreme newbie, far longest code i've ever worked on. #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string> using namespace std; int main() { string a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,y,z; cout<<"enter name:"; cin>>a; cout<<"enter gender:"; cin>>z; cout<<"enter age:"; cin>>b; cout<<"enter address:"; cin>>c; cout<<"enter school:"; cin>>d; cout<<"enter nickname:"; cin>>e; cout<<"enter highest educational attainment:"; cin>>f; cout<<"what sk

pandas string contains lookup: NaN leads to Value Error -

if filter rows string in column value, possible use data.sample_id.str.contains('hph') (answered before: check if string in pandas dataframe column in list , or check if string in pandas dataframe ). however, lookup column contains emtpy cells. terefore, str.contains() yields nan values , value error upon indexing. `valueerror: cannot index vector containing na / nan values`` what works: # runs mask = [index index, item in enumerate(data.sample_id.values) if 'zent' in str(item)] is there more elegant , faster method (similar str.contains() ) 1 ? you can set parameter na in str.contains false : print (df.a.str.contains('hph', na=false)) using edchum sample: df = pd.dataframe({'a':['hph', np.nan, 'sadhphsad', 'hello']}) print (df) 0 hph 1 nan 2 sadhphsad 3 hello print (df.a.str.contains('hph', na=false)) 0 true 1 false 2 true 3 false name: a, d

php - Apache HTTP SERVER has stopped working while using soap client in -

getting apache http server has stopped working while using soap client in. if soap api url not exist getting attached screen shot error again getting error i using xampp v3.2.2 php7. code using try { $vies = new soapclient('http://www.webservicex.com/spc/globalweather.asmx?wsdl', array('exceptions'=>true)); var_dump($vies); } catch(soapfault $e){ $return_value = 'vat check service not available.'; return $return_value; } note:- same code working fine 5.6. thanks in advance

jquery - JavaScript Button disabled Value? -

is possible button disabled if bank balance small? example: bank balance = 3 , button bank balance = 5 <- button disabled so need enough money button not disabled is! i hope understand mean , hope can me! my button : <button type="sumbit" name='einzahlen' class="btn btn-info btn-block btn-md">pin einlösen</button> check simple code in jquery , hope helps you! $(document).ready(function(){ $('#chk').click(function(){ var bal = parsefloat ($('.balance').text()); if(bal <= 50){ $('#btn').attr('disabled','disabled'); } }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <button type="sumbit" name='einzahlen' class="btn btn-info btn-block btn-md" id="btn">pin einlösen</button> <button id="chk">check bal

How to refresh JWT token using interceptors in angularjs? -

i having application back-end implementation in lumen gives jwt token every time user logs in. front end using angular save token in local storage , adding headers in subsequent requests. check expiry of token , refresh creating request using https://github.com/auth0/angular-jwt i adding token refresh code in config of app method never called when make other requests here code tried. app.config(function config($httpprovider, jwtinterceptorprovider) { jwtinterceptorprovider.tokengetter = function(jwthelper, $http,$localstorage) { if ($localstorage.currentuser) { var token = $localstorage.currentuser.token; if (jwthelper.istokenexpired(token)) { return $http({ url: 'http://backend.mywebsite.com/token', method: 'get' }).then(function(response) { var token = response.token; $localstorage.currentuser.token = token; $http.defaults.headers.common.authorization = 'bearer ' + $localstorage.curren

python 2.7 - PyGtk : destroying combobox causes error -

my aim destroy combobox if 1 of items active. i wrote test code : import pygtk pygtk.require('2.0') import gtk import gobject def remove(combobox): if 'optionc' in combobox.get_active_text(): combobox.destroy() window = gtk.window(gtk.window_toplevel) window.set_default_size(800, 600) window.set_title("test") window.connect("destroy", gtk.main_quit) main_box = gtk.vbox(false, 2) window.add(main_box) nb = 3 in range(nb): liststore = gtk.liststore(gobject.type_string) combo = gtk.combobox(liststore) cell = gtk.cellrenderertext() combo.pack_start(cell, true) combo.add_attribute(cell, 'text', 0) text in ["optiona-%d"%(i+1), "optionb-%d"%(i+1), "optionc-%d"%(i+1)]: combo.append_text(text) combo.set_active(0) combo.connect("changed", remove) main_box.pack_start(combo, expand=false) window.show_all() gtk.main() if open popup of combobox , click select "optionc&quo

sql - How to write select query for taken Lastupdated rows from table -

i new sql query can 1 know how last updated records table using sql query. table schema: user name | softwarename | publisher scan time | user name | softwarename | publisher | installed date 08-05-2016 04:44:00 | yyy | msoffice | microsoft | 08-08-2016 09:34:00 pm 08-06-2016 12:12:00 pm | xxx | msoffice | microsoft | 08-08-2015 01:09:00 08-06-2016 12:52:00 pm| xxx | chrome | google | 08-07-2015 02:30:20 pm last 2 rows updated 08-08-2016 need select query last updated records (08-08-2016) you want records of last day. trim time part datetime casting date, order this, top 1 day ties , done: select top 1 ties * mytable order cast([installed date] date) desc;

VB.NET XML Attribute does not appear correctly -

i have output this: <ricette xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nonamespaceschemalocation="xml.xsd"> but obtain this: <ricette xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" nonamespaceschemalocation="xml.xsd"> xsi:nonamespaceschemalocation doesn't appear correctly here piece of code: dim xmlnsxsiattribute xmlattribute = myxmldocument.createattribute("xmlns:xsi") xmlnsxsiattribute.value = "http://www.w3.org/2001/xmlschema-instance" dim xsiattribute xmlattribute = myxmldocument.createattribute("xsi:nonamespaceschemalocation") xsiattribute.value = "xml.xsd" node.attributes.append(xmlnsxsiattribute) node.attributes.append(xsiattribute) how can solve this? you can use xmlelement.setattribute() method add namespaced attribute element : .... node.setattribute("xmlns:xsi", "http://www.w3.org/2001/xmlschema-instance") n

How to use python-ldap to modify configuration DIT of openldap? -

for example, can use following command change rootdn password: sudo ldapmodify -h ldapi:// -y external -f newpasswd.ldif the contend of newpasswd.ldif is: dn: olcdatabase={1}mdb,cn=config changetype: modify replace: olcrootpw olcrootpw: {ssha}/z6e+b4l6ucglrli4ksnax142wdch6de my question is, how can implement using python-ldap? searched while, not find answer. i find solution, here code. def ldap_modify_root(): conn = ldap.initialize("ldapi://") conn.sasl_external_bind_s() old = {'olcrootpw': 'xxx'} new = {'olcrootpw': '{ssha}/z6e+b4l6ucglrli4ksnax142wdch6de'} ldif = modlist.modifymodlist(old, new) dn = "olcdatabase={1}mdb,cn=config" conn.modify_s(dn, ldif) conn.unbind()

Manage ssh keys within Bluemix -

how clean ssh keys virtual servers. have defined number of keys want delete of them , start fresh i guess right option delete them through openstack client on command line. see here details , on obtain client. list available ssh keys: openstack keypair list delete specific ssh key: openstack keypair delete mykey

sprite kit - Xcode 8 beta 4 crashes every time when opening .sks file -

i'm trying start new xcode project in beta 4 game template can't rid of "hello" label because seems hidden in 1 of .sks files. problem: xcode 8 crash every single time try open .sks file. any solution this, other waiting next beta? thanks help.

angularjs - Showing values from object in select dropdown angular -

from api call receiving object looks , assigning $scope.countries : $scope.countries = { au:"australia", be:"belgium", us:"united states" } in front end want add each country dropdown list, show full country names below. have taken many different approaches cannot work. - australia - belgium - united states please see code below: <select ng-options="(key, value) in countries" ng-change="getroles()"> try , var app = angular.module('plunker', []); app.controller('mainctrl', function($scope) { $scope.countries = { au:"australia", be:"belgium", us:"united states" } }); <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js"></script> <body ng-app="plunker" ng-controller="mainctrl"> <select ng-model="country" ng-options="key value (key , value) in countrie

exception - Laravel Queue Error -

i working on laravel queues, , have job written update database variable. can't test functionality because when execute php artisan queue:listen throws class not found exception. , can't debug error. i'm suspecting forget import class or didn't imported correctly @ top, why laravel unable find class trying instantiate .

java - debug mode breakpoints does not work in valueChangeListener -

ı not warning or error messages in console. debug mode breakpoints not work in valuechangelistener method in bean class. methods work @ debug mode in bean class. ı tried ajax listener.(ı using maven) anbody have idea? xhtml file: <?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:b="http://bootsfaces.net/ui" xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"> <h:body> <ui:composition template="/template/template.xhtml"> <ui:define name="menu"> <ui:include src="/template/menu.xhtml"> <ui:param name="menuid" value