Posts

Showing posts from September, 2011

sql - display the count of the rows created in each hour in last day with 0 count when rows are not created -

i have table below. date |name |number 5/11/2016 17:00:50| abc |123 5/11/2016 18:00:05| def |456 5/11/2016 18:15:00 |ghi |789 i have display count of rows created in each hour in last day. , when no rows created in hour, should display count 0. have limitation of not use pl/sql or multiple queries. i have tried below query, problem is howing both rows of count 0 , count select trunc(sysdate ,'hh') - level/24 dates , 0 count dual connect level <= 24 union select trunc (date, 'hh') dates, count(*) count table date> sysdate -1 group trunc (date, 'hh') . date |count 04-nov-16 08.00.00 |0 04-nov-16 09.00.00 |0 04-nov-16 10.00.00 |0 04-nov-16 11.00.00 |0 05-nov-16 12.00.00 |0 05-nov-16 01.00.00 |0 05-nov-16 02.00.00 |0 05-nov-16 03.00.00 |0 05-nov-16 04.00.00 |0 05-nov-16 05.00.00 |0 05-nov-16 06.00.00 |0 05-nov-16 07.00.00 |0 05-nov-16 08.00.00 |0 05-nov-16 09.00.00 |0 05-nov-16 10.00.00 |0...

java - SpringMVC POST method mapping won't load page when the method contains a specific Class -

i have item class , form: <form:form method="post" commandname="item" action="/item/add"> @requestmapping(value = "/add", method = requestmethod.post) public string itemadd(@modelattribute("item") item item){ whenever include item in function parameters, page not load. method works fine. including other class in parameters (or empty) works fine need use item in function. anyone have ideas why isn't working?

java - How to write spring batch process to read from websphere mq and write into oracle database? -

can provide template spring batch process read input ibm websphere mq , write oracle database. i tried write template not working please let me know how things has done further getting error: invalid property 'msgconsumer' of bean class: [org.springframework.jms.listener.defaultmessagelistenercontainer]: bean property 'msgconsumer' not writable or has invalid setter method. parameter type of setter match return type of getter? <beans xmlns="http://www.springframework.org/schema/beans" xmlns:batch="http://www.springframework.org/schema/batch" xmlns:task="http://www.springframework.org/schema/task" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.2.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/bean...

java - Allow nested JSplitPanes to control parent JSplitPanes -

Image
below code simple layout created using several nested jsplitpanes . import java.awt.color; import java.awt.dimension; import java.awt.gridlayout; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jpanel; import javax.swing.jsplitpane; public class cdburner extends jframe { private static final long serialversionuid = -6027473114929970648l; jsplitpane main, folder, rest; jpanel centeral, folders, favourites, tasks; jlabel label; private cdburner() { super("dan's cd burner"); setdefaultcloseoperation(jframe.exit_on_close); setlayout(new gridlayout(1, 1)); getcontentpane().setbackground(color.black); createlayout(); pack(); setminimumsize(getsize()); setextendedstate(getextendedstate() | jframe.maximized_both); setvisible(true); requestfocus(); } private void createlayout() { createpanels(); rest = new jsplitpane(jsplit...

android - databinding does not exist: How to solve it? -

i'm working on android application databinding i've next error: error: package my.package.databinding not exist. here build.gradle on project level: buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.2' } } allprojects { repositories { jcenter() } } task clean(type: delete) { delete rootproject.builddir } i've enabled binding in build.gradle file on module level. now question is, why occurs error , how solve it? this problem occurs if project not compile. android databinding should generate code in named package, can't if project doesn't compile in first place. to solve this, bring project point compiles. if necessary, turn databinding off this.

angularjs - How to unit test of a function which are inside another one -

for unit testing use jasmine.i want test filterlist function . how ? problem mock service object, how declare method inside mock object can test filterlist function. ignore syntax , because copy paste code , delete lines, chances high there lots of syntax error. function (_,angular) { 'use strict'; var ngdependencies = ['stateservice','$scope','$rootscope']; var constructor = function constructor(stateservice,$scope,$rootscope) { var self = this; self.defaultselectedcompany = {}; self.companies = { available: [] }; var changelistener = stateservice.subscribe(function () { self.companies.available = stateservice.getavailable('clients'); self.mycompanylist = _.map(self.companies.available, function companylist(user) { return { id: user.name}; }); self.filterlist = function filterlist($searchval, $l...

javascript - why does my 'click' addEventListener getting called on pageload -

i have button id #login , javascript file line: document.getelementbyid('login').addeventlistener('click', 'loginpressed()') as test, made function: function loginpressed(){ console.log('was login pressed already??') } and function getting called every time page loads. how stop happening? note, i've tried callback not in quotes, , not function: document.getelementbyid('login').addeventlistener('click', loginpressed()) document.getelementbyid('login').addeventlistener('click', loginpressed) document.getelementbyid('login').addeventlistener('click', 'loginpressed') because invoking it, rather referencing it. this: document.getelementbyid('login').addeventlistener('click', 'loginpressed()'); should this: document.getelementbyid('login').addeventlistener('click', loginpressed); there should not parenthesis after loginpres...

Django Rest queryset inside APIview -

i have 2 serializers 2 models want combine 2 serializers 1 view class productrequestview(apiview): permission_classes = [isauthenticatedorreadonly] def get(self, request): city_serializer = citycompactserializer models = modelsnestedserializer data = {'cities':{'city data'}, 'models': {'models data'}} return response(data, status=http_200_ok) i think have pass queryset both serializers data. how can inside view. new drf. ? thanks class productrequestview(apiview): permission_classes = [isauthenticatedorreadonly] def get(self, request): data = { 'cities': categorycompactserializer(<categorymodel>.objects.all(), many=true).data 'models': modelsnestedserializer(<modelsmodel>.objects.all(), many=true).data } return response(data, status=http_200_ok)

c# - WPF Binding to object created within MainWindow class -

so need bind simple label property of object created class. class trying create goes this: public class creature : inotifypropertychanged { public event propertychangedeventhandler propertychanged; protected void onpropertychanged(string name) { propertychanged?.invoke(this, new propertychangedeventargs(name)); } private string _name = "default"; public string name { { return _name; } set { _name = value; onpropertychanged(nameof(name)); } } private string _gender = "default"; public string gender { { return _gender; } set { if (_gender != value) { _gender = value; onpropertychanged(nameof(gender)); } } } } then create instance of in mainwindow.xaml.cs this: public partial class mainwindow : window { private creature player = new creatu...

How can I get the value of 'username' inside the function Login() to use it on another python program? -

from tkinter import * root = tk() root.geometry("230x100") l1 = label(root, text="login page", bg = "blue", fg = "white") l1.pack(fill = x, ipadx = 5, ipady = 5) v = stringvar(root, value='enter username here') e1 = entry(root, textvariable=v) e1.pack(side = left, padx = 5, pady = 5) def login(): username = v.get() print "username '" + username + "'" b1 = button(root, text ="login" , command = login) b1.pack(side = right, fill = x, pady=5) mainloop() i have been trying value of 'username' in function login() use on python program. i have tried setting global variable , changing scope not getting anything. i need use value of 'username' outside function login(). please provide insights. think scope moment. when program ends, memory (meaning variables, objects, etc.) released. 2 ways can think of pass 1 program is: 1) write username value file next prog...

excel - Function with multiple parameters -

Image
i have vba function multiple arguments, need excel sheet , not sub, how divide inputs number of parameters need function? ex: function func(a double,b double) double 'calculations 'some return value end function this how have been trying values: if want handle multiple arguments of don't know number of, use paramarray argument for instance, assuming func() should sum arguments pass it: function func(paramarray args() variant) double dim long dim cell range = lbound(args) ubound(args) '<--| loop through each passed argument if typename(args(i)) = "range" '<--| if current element range each cell in args(i) '<--| loop through range cells func = func + cell.value next cell else '<--| otherwise func = func + args(i) '<--| process current argument value end if next end function

batch file - Why is IBM Tivoli Netcool Omnibus's Summary is not fully printed? -

i need print omnibus "summary" string. have trigger executes procedure: begin each row critical in alerts.status critical.alertkey = 'disk_usage_crit' begin execute send_email( critical.node, critical.severity, critical.alertkey, 'netcoolemail', critical.summary, 'winitmsvr631'); end; end that trigger passes values of critical node, severity, alertkey, 'netcoolemail', summary , host name parameters procedure named send_email . this procedure body: (node char(1), severity int, situation char(1), email char(1), summary char(1), hostname (1)). this procedure passes values of parameters variables in batch file. set node=%1 set situation=%3 set summary=%5 echo %node% >> c:\ibm\logtest.txt echo %situation% >> c:\ibm\logtest.txt echo %summary% >> c:\ibm\logtest.txt when echo variables , redirect them text file, summary string truncated while others being printed expected. this how summary variable look...

merge - Symmetrically balanced merging of arrays -

is there way take 2 arrays of data , merge them new array data uniformly or symmetrically balanced possible? here few examples of mean... xxx + oo = xoxox xxxxxxx + ooo = xxoxxoxxox xxxxxxxx + oooo = oxxxoxxoxxxo i don't know how define problem mathematically, can understand mean visually. particular problem have kind of name? know of use case might come up? i find interesting , write program takes 2 lists of data , this.

How to check if input is incorrect in bash? -

this question has answer here: why should there space after '[' , before ']' in bash? 4 answers i trying write bash script takes data users , display entered information them. take date , time using following: echo "enter day:" read day echo "enter time (hour):" read hour if [["$hour" -gt 24 || "$hour" -lt 1]] echo "wrong data" echo "enter time (hour):" read hour fi when run following enter: ./file1.sh: line 5: [[27: command not found ./file1.sh: line 5: 27: command not found 27 number entered hour. you need space after [[ , before ]] .

html - How to style 3 (div) boxes using CSS -

i have html page: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>title</title> <link rel="stylesheet" href="stylebox.css"> <script src="script.js"></script> </head> <body> <div> <div> <div> text </div> </div> </div> </body> </html> this page should - http://pasteboard.co/nflmljzpg.png i have tried something, not know hot style text inside third div without editing html page my css: div { width: 380px; height: 300px; background: #b0cde9; border-style: solid; border-color: black; border-width: 1px; } div div { width: 290px; height: 280px; background: yellow; margin-left: 45px; margin-top: 8px; } div div div { width: 120px; height: 140px; background: #82c940; ...

Python/Numpy/Scipy, Solving non-linear least squares, with grouped covariates? -

Image
basically, i'm trying make function happen: where i'm solving beta. gamma, alpha, , x data. originally, used summary statistic mean(xi/gamma_i), meant in summation pre-calculated, , present simple np array non-linear optimizer... there's no way pre-calculate summary statistic, it's not clear how beta affect f when f changing in response alpha_i. thus, i'm not sure how go presenting array. possible embed covariates lists (numpy objects) still present numpy array, , unpack list within residual function? going wrong way?

Can WCF duplex service be used to call client when client is offline? -

is possible service call client after 4 -5 days when client offline? e.g. 1. client request reports through service. 2. service updates database client request. 3. offline work done on request 4. report uploaded database. can service call client , send report report uploaded database? can wcf duplex service used call client when client offline? yes. wcf can configured use msmq transport. msmq only wcf transport allows three: disconnected scenarios resume when computer becomes online , optionally provide level of guaranteed delivery msdn: if need support disconnected queuing, use netmsmqbinding . queuing provided using microsoft message queuing (msmq) transport, enables support disconnected operations , failure isolation, , load leveling. more... essentially invoke wcf method (send msmq message) , delivered when computer comes on-line again. assuming have set appropriate expiration options.

Excel dragging formula not incrementing properly -

Image
i have excel workbook broken down 2 sheets. on first sheet, of data organized vertically , wanting data show on second sheet horizontally. have been able work using formula. =sheet1!h2 =sheet1!h12 =sheet1!h22 =sheet1!h32 however, when select cells , click , drag down copy formulas duplicate ranges don't work. new cells have formula cell range wrong. =sheet1!h6 =sheet1!h16 =sheet1!h26 =sheet1!h36 i expecting this. =sheet1!h42 =sheet1!h52 =sheet1!h62 =sheet1!h72 i've tried using offset , i'm still having same problem. i'm not sure why it's no incrementing way i'm expecting to, hope can shed light on i'm missing. to clear bit. have excel file 2 sheets. sheet1 , sheet2. on sheet1, i'm pulling data access query. since of data listed in vertical columns, i'm trying sort data on sheet2 horizontally. i'm linking cells on sheet2 cells on sheet1. data on sheet 1 has variety of parts, numbers, , measurement values recorded. there 10 entr...

html - Activating parent link with keyboard focus on tabbable child without Javascript? -

consider situation this : <a href="#"> <div tabindex="0">tab focus me, ⏎</div> </a> if i'm focused on <div /> , press enter, different behaviour across major desktop browsers (os x yosemite): chrome 54.0.2840.71: parent link not activated. both <a /> , child <div /> separately selectable tab. firefox 48.0.2: <a /> doesn't seem selectable itself, link can activated focus on <div /> . opera 39.0: same behaviour chrome. safari 9.1.2: firefox, <a /> isn't selectable, when <div /> selected, link isn't activated. since <a /> can't nested, there way make focused child element activate parent link across browsers without javascript? javascript option obvious, find unbelievable simple need it. any element tabindex considered interactive content see: http://w3c.github.io/html/single-page.html#kinds-of-content-interactive-content the tabindex...

routing - How can I setup a static IP for router? -

hello stackoverflow community!i have question. let's begin.i have server @ home , want setup static public ip adress server... .i have pppoe/russia pppoe wan connection , tp-link router.(model no: tl-wr940n / tl-wr941nd ) answers! update: searching reason , understand need buy business services special that...thx anyway!

java - Try to convert Arraylist<LatLng> to string before insert to database -

i try insert arraylist<latlng> list1 lot of values this: (99.9999999,99.9999999) table in database mysql, exacly 1 column, this: row 1 (99.9999999,99.9999999) row 2 (99.9999999,99.9999999) row 3 (99.9999999,99.9999999) ... 1 column. in opinion, have method this: string sql = "insert table1 values("; for(string s : list1) { sql = sql+"'"+s+"'"; } sql = sql+")"; stmt.executeupdate(sql); but android studio underlines string s , says: incompatible types required: com.google.android.gms.maps.model.latlng found: java.lang.string in opinion, android studio trying me: need convert values arraylist<latlng> list1 string ! possible convert values arraylist in 1 method ? bad way of doing it: you can convert data string following way: for(latlng s : list1) { string sql = "insert table1 values('"+s+"'); stmt.executeupdate(sql); } that is, don't have spe...

create a histogram OCaml -

my task create histogram output number of times element in list. input:[2;2;2;3;4;4;1] output[(2, 3); (2, 2); (2, 1); (3, 1); (4, 2); (4, 1); (1, 1)] expected output : [(2, 3); (3, 1); (4, 2); (1, 1)] code: let rec count ls = match ls |[] -> 0 |x::xs when x=a -> 1 + count xs |_::xs -> count xs let rec count = function |[] -> 0 |x::xs when x=a -> 1 + count xs |_::xs -> count xs let rec histo l = match l |[] -> [] |x :: xs -> [(x, count x l)] @ histo xs ;; what have done wrong? the issue xs contains potentially elements equal x. see in ouput : (2,3) means there 3 times 2 in list; xs equals [2;2;3;4;4;1]... , on. also (not impacting conclusion): have 2 definitions of count, identical. to implement histogram, use hashtbl : let h = hashtbl.create 1000;; list.iter (fun x -> let c = try hashtbl.find h x not_found -> 0 in hashtbl.replace h x (c+1)) your_list;; hashtbl.fo...

javascript - JS - why such order of code execution? (Beginner level) -

what's logic behind order of js code execution? i'd expect after clicking button background become red , message show up. however, message appearing first , color applied background after click ok -> codepen . proper&correct way make background red before click ok? function run(){ document.body.style.backgroundcolor = 'red'; alert('contratulations!'); } <html> <head></head> <body> <button onclick="run()">click me!</button> </body> </html> the code executed in order expect, however, each of statements not synchronous, invoke funcitonality provided webbrowser. browser executed javascript not occur on ui thread. when change dom (the abstraction allow javascript interact browser html), instead triggers update ui (browser page) occurs separate javascript execution. underlying dom element updated, there non instantaneous update actual ui. in code, after chang...

java - How to get multiple Item selector ListView in android -

i developing app in want list of installed apps on device , show in list view of app. succeed in doing so. below code this.but there problem want user selected multiple items in shown listview of installed apps.i dont know how convert simple listview multiple item selector listview. every kind of appreciated. main_activity.xml: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="com.example.pc.fkidshell.teen3activity"> <include layout="@layout/toolbar" android:id="@+id/my_teen3toolbar"/> <listview android:layout_width="match_parent" android:layout_height="wrap_conten...

javascript - Problems using react-router for basic routing after installing it on a new project -

about 4 days ago, created project react-router . installed normal, following this guide . installed react-router via recommended method in official github readme. odd reason, wouldn't render of components until moved route index.js file in root directory, began work. before, route located inside of app.jsx file. today, decided wanted create small portfolio site myself, since feel i'm understanding basics of react. installed did before, w/ versions 3.0.0 , 15.3.2 of react-router , react / react-dom respectively. versions have not changed since last project few days back. however, seems react-router no longer working reason, showing no errors in console, , i've spent hours searching google , stack overflow solutions. code super bare-bones currently, index.js file looking following, without use of react-router : import react 'react' import {render} 'react-dom' class app extends react.component { render() { return <div>{this...

javascript - Multiple submit buttons in angular2 form -

i building angular2 form , have multiple buttons submit form, e.g "save" , "save , close". i have tried use simple buttons click action on them, didn't find anyway manually mark form submitted force form validation. <form #ticketform="ngform" novalidate> <input type="text" id="customername" required name="customername" [(ngmodel)]="ticket.customername" #customername="ngmodel"> <div class="tj-form-input-errors" *ngif="customername.errors && (customername.dirty || customername.touched || ticketform.submitted)"> <small [hidden]="!customername.errors.required"> customer name required </small> </div> <button type="button" (click)="save(ticketform)">save</button> <button type="button" (click)="saveandclose(...

web scraping - InvalidSchema("No connection adapters were found for '%s'" % url) in python -

this first time on webscraping , dont hard on me. learning scrape data out of site getting following error: raise invalidschema("no connection adapters found '%s'" % url) invalidschema: no connection adapters found '(' http://en.oxforddictionaries.com/definition/good ', 'html.parser')' this code: import requests bs4 import beautifulsoup url=('http://en.oxforddictionaries.com/definition/good',"html.parser") r=requests.get(url) soup=beautifulsoup(r.content) links=soup.find_all("a") i have seen other answers , notice need put http:// , have done no avail. thank time. the 'html.parser' parameter should passed beautifulsoup not requests.get . passing latter makes url nonsensical requests.get : url = 'http://en.oxforddictionaries.com/definition/good' ... soup = beautifulsoup(r.content, 'html.parser')

mod rewrite - .htaccess RewriteRule / Redirect based on query string/parameters? -

how rewrite in .htaccess call url: www.domain.com/?_wpm_gateway=paypal-standard&_wpm_action=ipn to point new ipn url (for paypal payments): www.domain.com/payments/paypal/ipn with, obviously, rest of parameters in ipn being passed on , sent on new url? any idea? and need rewrite rule if query/url called, otherwise should business normal, speak. edit: tried this, didn't work... ideas? <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{query_string} (?:^|&)_wpm_action=ipn(?:$|&) rewriterule ^ /payments/paypal/ipn? [ns,l,dpi,qsd] rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> you've got front. tell paypal new ipn url either in merchant settings, or per transaction in payment parameters send. don't redirect incoming ipn paypal. if worried missed ipns, silent internal rewrite of old new can processed without re...

java - Drawer layout - navigation header is scrolling ANDROID -

i've got problem. there a scrollable menu, textview scrolling too. don't want scrolling it. here main xml: <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ffffff" > <android.support.v7.widget.toolbar android:id="@+id/toolbarinner" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize"> </android.support.v7.widget.toolbar> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent"> <relativelayout android:id="@+id/content_frame_container" android:layout_width="match_parent" android:layout_hei...

ios - UICollectionviewCell backgroundColor not Change when selected -

i'm trying change backgorund color of cell when selected. cell background color not changing. func collectionview(_ collectionview: uicollectionview, didselectitemat indexpath: indexpath) { let cell = collectionview.dequeuereusablecell(withreuseidentifier: "cell", for: indexpath) as! categorycollectionviewcell let category = self.categories[indexpath.row] switch cell.isselected { case true: cell.backgroundcolor = .black default: cell.backgroundcolor = .white } cell.setneedsdisplay() } you don't need manually change background color upon selection. uicollectionviewcell has property called selectedbackgroundview precisely purpose. use in collectionview(_:cellforitemat:) delegate method follows: func collectionview(_ collectionview: uicollectionview, cellforitemat indexpath: indexpath) { let cell = collectionview.dequeuereusablecell(withreuseidentifier: "ce...

Finding duplicate words in a string python -

i trying make function locate duplicate words , if output should true or false depending on wether there duplicate words. example: doubleword("cat") --> false . doubleword("catcat") --> true . doubleword("contour" * 2) --> true so far have this: def main(): word = input("enter string: ") half = len(word) >> 1 if word[:half] == word[half:]: print("true") else: print("false") return print(main()) if name == " main ": main() any appreciated. thought maybe using slicing make easier have no idea how implement in code. thanks! you have compare first part second, can slicing this: def doubleword(word): return word[len(word) // 2:] == word[:len(word) // 2]

r - Trying to generate maps for flight departures and arrivals -

Image
the script below works, seems stuck on line. mappoints <- ggmap(map) + geom_point(aes(x = lon, y = lat, size = sqrt(flights)), data = airportd, alpha = .5) here entire thing. airports <- read.csv("https://raw.githubusercontent.com/jpatokal/openflights/master/data/airports.dat", header = false) colnames(airports) <- c("id", "name", "city", "country", "iata_faa", "icao", "lat", "lon", "altitude", "timezone", "dst") # head(airports) library(rworldmap) newmap <- getmap(resolution = "low") par(mar = rep(2, 4)) plot(newmap, xlim = c(-20, 59), ylim = c(35, 71), asp = 1) points(airports$lon, airports$lat, col = "red", cex = .6) routes <- read.csv("https://raw.githubusercontent.com/jpatokal/openflights/master/data/routes.dat", header=f) colnames(routes) <- c("airline", "airlineid", "sourcea...

Sublimetext 3 c++ compilation error "undefined reference to class::constructor() -

i have problem sublimetext 3 , undefined reference class constructor. think problem linking. i've got main.cpp, student.cpp , student.h. code simple now main.cpp: #include "student.h" int main(int argc, char const *argv[]) { student student1; return 0; } student.h: #ifndef _s #define _s #include <iostream> using namespace std; class student { public: student(); ~student(); }; #endif end student.cpp #include "student.h" student::student() {} student::~student(){} any suggestion packages have install or change? i grateful help maria edit: thank answers! resolve problem making makefile. had install gnuwin , 'make' work, on sublime i've choosen buildsystem - > make , how makefile looks like: new=5.1 new2 = student komp=g++ flags= -std=c++11 -wall -g $(new):$(new).o $(new2).o $(...

android - Shared element transition: image view turns white -

i have recycler view containing bunch of images. when tap on 1 of them detail activity launched, transitioning image. problem while animation running image view turns white moment doen't good. i'm using glide load images if matters. thank in advance! i have solution if interested. problem image wasn't loaded @ time animation performed. work around keep transition postponed until image loaded. postponeentertransition(); //postpone transition startpostponedentertransition(); //proceede when callback called

why print out wrong result. python enumerate, counter -

# -*- coding: utf-8 -*- collections import counter import itertools, collections listea=['it', 'was', 'the', 'besttttttttttttttrtrtrtrtrttrtr', 'of', 'times', 'it', 'was', 'the', 'worst', 'of', 'times', 'it', 'was', 'the', 'age', 'xx', 'xx', 'xx', 'xx', 'xx', 'xx', 'xx', 'xx', 'xx', 'xx' 'of', 'wisdom', 'it', 'was', 'the', 'age', 'of', 'xx' 'foolishness'] index = collections.defaultdict(list); value, key in enumerate(listea): index[key].append(value) key1,value1 in index.items(): if len(value1)>=4: print value1 output not correct. problem code. output seems [0, 6, 12, 27] [16, 17, 18, 19, 20, 21, 22, 23, 24] [2, 8, 14, 29] [1, 7, 13, 28] i add number r...

html - Vertical menu with stacked text -

i have created fixed vertical menu stacked text jsfiddle each of sections 100% height. wasn't sure if correct way things, used span elements , set them display: block; <a class="page-scroll" href="#header"> <span> h </span> <span> o </span> <span> m </span> <span> e </span> </a> now have kind of works, seeing dealing 100% heights each section, trying place menu vertically aligned within middle of container. have tried using property on ul not move whole menu middle. i thinking using margin top of 50%, if add more items menu may not work. additionally, if did add more items menu, there way of ensuring whole menu displayed within viewport, not overlapping section? have updated jsfiddle demonstrate mean. because have added couple of menu items menu, test2 seems disappear because not fit viewport. there way can avoid this? any advice appreciated. thanks use ...

printing - java pdfbox setting printer tray -

i have been having problem setting paper source on printer directly java. want able print printer's non-default paper source, using custom size paper source. default source may be, tray 1 contains a4, want program choose tray 2 non-standard paper size. i have managed tray id using code based on https://github.com/marco76/mediatraytest/blob/master/src/main.java changes make work pdfbox. i have tried code using id need, printer still prints default tray. any thoughts?

Doubly Linked List Java -

i'm having confusion creating dllist in java. instructions dllnode class should have links point previous , next nodes. need create under data section or method? thank time you can start declaring ddlist this: public class dllist { private static class node { int data; node previous; node next; node(int d) { data = d; } } private node head; private node tail; // ... } some highlights: the node class inner class of ddlist , member. declared in same section other members, e.g. fields. call "data section" believe. you can declare head , tail before node . thanks static, node not have reference ddlist . saves (only) 4 bytes per node can avoid memory leaks if pass unlinked nodes outside ddlist . better style ihmo. thanks private, node not visible outside dllist . since need access class access fields, similar setting node 's fields private. more efficient because ...

r - Can `knitr` suppress execution or output in an sql chunk? -

Image
the document below runs sql , shows results. don't want output show up, either not running chunk, or hiding output. is there way this? --- output: html_document --- ## hide sql output first, set temporary database: ```{r} library(rsqlite) conn <- dbconnect(sqlite(), tempfile()) df <- data.frame(value = runif(1)) dbwritetable(conn, "testtable", df) ``` show query, try not run it, , try hide output. neither works: runs, , displays table. ```{sql connection = conn,results="hide",eval=false} select * testtable; ``` i output: i found workaround. if use mysql engine instead of sql engine, @ least eval = false works: ```{mysql eval=false} select * testtable; ``` will display code syntax highlighting not execute anything. i don't know if results="hide" supported, because don't have mysql installed.

Installing lxml, libxml2, libxslt for Python 3.5 on Windows 10 -

i first try run basic pip install command it: c:\program files (x86)\python35-32>pip install lxml collecting lxml using cached lxml-3.6.4.tar.gz building wheels collected packages: lxml running setup.py bdist_wheel lxml ... error complete output command "c:\program files (x86)\python35-32\python.exe" -u -c "import setuptools, tokenize;__file__='c:\\users\\djidiouf\\appdata\\local\\temp\\pip-build-ovqa6ncd\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d c:\users\djidiouf\appdata\local\temp\tmp9hzx5gztpip-wheel- --python-tag cp35: building lxml version 3.6.4. building without cython. error: b"'xslt-config' not recognized internal or external command,\r\noperable program or batch file.\r\n" ** make sure development packages of libxml2 , libxslt installed ** c:\users\djidiouf...

c - How can I suspend/kill a child process from the child using keyboard? -

in shell program reading keyboard via readline: rl_bind_keyseq ("\\c-c", readline_func); // ctrl + c int readline(...){ // handle keyboard controls } this works when i'm in outside loop, once long command such 'wc' i'm in child process, ctrl+c not being picked up, ^c in terminal. keystrokes defined before forked. i'm interested in killing process, when i'm running 'wc' , ctrl+c detected, i'll kill(pid, sigint) my parent process waiting child via: waitpid(pid, &child_status, 0); also able call kill within child stop/pause?

Scala 2.12 and Travis.ci - how to exclude the combination with Java 6? -

adding scala 2.12 .travis.yml produces new problem me, because builds fail under java 6: language: scala scala: - 2.12.0 - 2.11.8 - 2.10.6 jdk: - oraclejdk8 - openjdk6 how can fix exclude combination (scala 2.12.0, jdk opendjk6)? a simple search rendered answer looking for, believe travis.yml needs configuration matrix: # scala 2.12 requires java 8 exclude: - scala: 2.12.0-m5 env: jdk=oraclejdk7 - scala: 2.12.0-m5 env: jdk=openjdk7 - scala: 2.12.0-rc1 env: jdk=oraclejdk7 - scala: 2.12.0-rc1 env: jdk=openjdk7 - scala: 2.12.0-rc2 env: jdk=oraclejdk7 - scala: 2.12.0-rc2 env: jdk=openjdk7 - scala: 2.12.0 env: jdk=oraclejdk7 - scala: 2.12.0 env: jdk=openjdk7 https://github.com/typesafehub/scala-logging/blob/master/.travis.yml

php - Using volley to retrieve data(multiple rows) from mysql -

i'm creating quiz app , have retrive question display.this php , java code.i'll store data in array.i'm not able fetch data sql table. stringrequest stringrequest = new stringrequest(request.method.post,inserturl, new response.listener<string>() { @override public void onresponse(string response) { try { jsonarray=new jsonarray(response); jsonobject jsonobject=jsonarray.getjsonobject(0); for(int k=0;k<jsonarray.length();k++) { question[k]=jsonobject.getstring("question"); opta[k]=jsonobject.getstring("optiona"); optb[k]=jsonobject.getstring("optionb"); optc[k]=jsonobject.getstring("optionc"); ...