Posts

Showing posts from January, 2015

javascript - Activating overlay background when hovering over link -

Image
i preparing layout blog , need make slideshow more or less follows: i'm able lot via css, have problem! images activate when mouse hovers on div , need image activated, or better, colored, when hovering on image link. could me out this? take code via bootply bootply i not know if via css or via javascript. tried more via javascript not know it. you need use pseudo-class :hover on parent of image , text. change opacity of image when hover on child of element. change this .img-box-feature:hover{opacity:1;} to this [class*="box-"]:hover .img-box-feature{opacity:1;} see updated bootply also, suggest change classes box-um , box-dois , , box-tres box . can use .box:nth-child() or .box:nth-of-type() target specific one.

java - I want to implement docker in spring and hibernate application using gradle -

i had develop application using gradle , spring-hibernate. want implement docker in same. can tell me how proceed. read many tutorials of docker unable right resource. you develop application same way before. additionally create dockerfile uses java image parent. cmd pass java -jar ... command. more details can find on provided link above.

c++ - Why including atomic - gives errors -

i'm using g++ (gcc) version 4.9.2 under ubuntu 64 bit 14.04. i'm trying compile following simple code: #include <iostream> #include <atomic> using namespace std; int main() { cout << "!!!hello world!!!" << endl; // prints !!!hello world!!! return 0; } and following errors: /usr/include/c++/4.9/atomic:385:56: error: ‘noexcept’ not name type memory_order __m = memory_order_seq_cst) volatile noexcept ^ /usr/include/c++/4.9/atomic:389:53: error: expected ‘;’ @ end of member declaration load(memory_order __m = memory_order_seq_cst) const noexcept ^ /usr/include/c++/4.9/atomic:389:59: error: ‘noexcept’ not name type load(memory_order __m = memory_order_seq_cst) const noexcept ^ /usr/include/c++/4.9/atomic:393:59: error: expected ‘;’ @ end of membe

php - add 4 hours for UTC Time -

so create form outside of calendar script using. i submitting date java date picker works great. problem script uses date subtracts 4 hours based on it's needs. is there way add 4 hours submitted date shows correctly in admin when go approve event submitted. example: i submit form 10:00 admin reads 6 am the code in admin of script compensating utc. <?php if (!isset($_post['submit'])) { ?> <?php } else { $input_arr = array(); foreach ($_post $key => $input_arr) { $_post[$key] = addslashes($input_arr); } $user_id = $_post['user_id']; $listing_id = $_post['listing_id']; $status = $_post['status']; $title = $_post['title']; $description_short = $_post['description_short']; $description = $_post['description']; $venue = $_post['venue']; $location = $_post['location']; $admission = $_post['admission']; $contact_name = $_pos

php - Display a calendar in wordpress -

i searching lot last 2 days regarding this. given appreciable. wish display neat yearly calendar on website. after displayed, need dates mysql database , reflect them on calendar. , not able display calendar. can me providing way towards library or code or might me this. dont need google calendar. please suggest me something. have no idea of doing this. you can try plugin display calander/events . here https://wordpress.org/plugins/the-events-calendar https://wordpress.org/plugins/spider-event-calendar/screenshots/ https://wordpress.org/plugins/my-calendar/screenshots/

Rails: Form help -- supplying method with argument -

i relatively new rails , have attempted write small loan app user can make loan , app can track balances / etc. adding function loan model handles payments , have gotten far (draw attention make_payment(value) portion: loan.rb class loan < activerecord::base belongs_to :lender, :class_name => 'user' belongs_to :borrower, :class_name => 'user' has_many :payments default_scope -> { order(created_at: :desc) } validates :amount, presence: true validates :lender, presence: true validates :borrower, presence: true def make_payment(value) remainder = amount - value update_attribute(:amount, remainder) return remainder end end i can use correctly deduct value original loan amount, cannot seem make work using views , form. view follows: app/views/loans/show.html.erb <p id="notice"><%= notice %></p> <div class="row"> <div class="col-md-2"> <ul>

Do I need to keep server.key and server.csr for SSL in my rails app directoy? -

currently, in rails directoy (including github) have these files: website_name.crt server.csr server.key server.pass.key do have keep these files here ssl work? or dangerous keep them there. you should never ever expose server.key public. if have granted them key kingdom! , has key can decrypt ssl/tls connections , see what's what. keep hidden, keep safe.

swift - Comparing structs that conform to a protocol -

i have following structs represent point or line: public struct point{ let x : double let y : double init (x : double, y : double) { self.x = x self.y = y } } extension point : equatable{} public func ==(lhs: point, rhs: point) -> bool { return lhs.x == rhs.x && lhs.y == rhs.y } and public struct line { let points : [point] init(points : [point]) { self.points = points } } extension line : equatable {} public func ==(lhs: line, rhs: line) -> bool { return lhs.points == rhs.points } i want able have shape protocol or struct can use have points , lines , can compare between them. tried conforming protocol shape swift compiler gives me error when want compare point line though shapes. do have move struct classes? think may have use generics don't know how solve issue. in advance guidance. edit1: my approach shape protocol trying stuff nothing worked

php - How to add data in database in codeigniter -

there 2 tables. category(idcategory,name,url) subcategory(id,name,url,idcategory) in codeigniter have controller named submenu , view vwsubmenu. in add function have add name, url , idcategory subcategory table.but in view page there 3 field 1 input type text(name),input type text(url),select type name of category category table. now want take id of category table name (which input of select type)and insert subcategory table in idcategory field. how in codeigniter. please help first improve database structure. create table if not exists `category` ( `idcategory` int(11) not null auto_increment, `parent_id` int(11) not null, `name` varchar(255) not null, `url` varchar(255) not null, primary key (`idcategory`) ) engine=innodb default charset=latin1 auto_increment=8 ; try ... http://forum.codeigniter.com/archive/index.php?thread-493.html

mysql - doctrine:schema:update not updating y database -

some how whatever changes make in entites,doctrine doesn't seem update it.i know there similar questions.i have gone through them , tried : php app/console cache:clear php app/console doctrine:cache:clear-metadata php app/console doctrine:schema:update --force i have never imported database,so there no orm.yaml files in src folder. i using mysql database symfony , doctrine orm. here config doctrine: dbal: driver: pdo_mysql host: "%database_host%" port: "%database_port%" dbname: "%database_name%" user: "%database_user%" password: "%database_password%" charset: utf8 # if using pdo_sqlite database driver: # 1. add path in parameters.yml # e.g. database_path: "%kernel.root_dir%/data/data.db3" # 2. uncomment database_path in parameters.yml.dist # 3. uncomment next line: # pat

c++ - Controlling the unpacking of multiple variadic parameter packs for a fancier tuple_for_each -

background/motivation i've been playing around vc++2015, looking @ ways of writing utility routines handle tuples , other variadic bits , pieces. my first function of interest common-or-garden tuple_for_all function. function f , tuple t call in turn f(get<0>(t) , f(get<1>(t) , , on. so far, straightforward. template<typename tuple, typename function, std::size_t... indices> constexpr void tuple_for_each_aux(function&& f, tuple&& t, std::index_sequence<indices...>) { using swallow = int[]; static_cast<void>(swallow{ 0, (std::forward<function>(f)(std::get<indices>(std::forward<tuple>(t))), void(), 0)... }); } template<typename function, typename tuple> constexpr void tuple_for_each(function&& f, tuple&& t) { return tuple_for_each_aux(std::forward<function>(f), std::forward<tuple>(t), std::make_index_sequence<std::tuple_size<std::decay_t<tuple>>:

to parse php into html using htaccess in latest godaddy server configuration -

i parsing php html using .htaccess in go-daddy server bought in 2014 , using code: addhandler fcgid-script .html fcgiwrapper /usr/local/cpanel/cgi-sys/php5 .html i tried above code in new server not working. it's possible go-daddy changed configuration. any ideas?

java - I want to Change Date Format -

i want change date 3 7 2015 3aug 2015 i have date value : int day=3,month =7 ,year =2015 it's simple try below sample code :- import java.text.simpledateformat; import java.util.calendar; public class dateformatter { public static void main(string[] args) { calendar cal = calendar.getinstance(); cal.set(2015, 7, 3); simpledateformat sdf = new simpledateformat("dmmm yyyy"); system.out.println("formatted date : " + sdf.format(cal.gettime())); } } output formatted date : 3aug 2015

javascript - HTML5 WebWorkers, timed function -

i trying webworker count 100 , update div value of i, div updates straight 100 , seems ignore interval.... javascript (webworker file): self.addeventlistener('message', function (e) { switch (e.data) { case 'hi worker': postmessage('hi boss'); break case 'count 100': var i; (i = 0; < 100; i++) { setinterval(postmessage(i + 1), 1000); } break; default: self.postmessage("not sure how that"); } }, false); main file: <script> var worker = new worker('worker.js'); worker.addeventlistener('message', function (e) { console.log("worker said: " + "'" + e.data + "'"); document.getelementbyid("workercomms").textcont

Url rewrite of dynamic php page not working in both directions -

my web page largely dynamic. figured out how rewrite these urls (apache server). the first page did https://www.roguefab.com/category.php?category=tubing_benders the clean url page https://www.roguefab.com/category/tubing_benders if navigate www.roguefab.com/category/tubing_benders, works perfect (shows content , clean url). if navigate directly or link dirty url, shows dirty url. why? shouldn't show clean one? my rewrite code every other 1 i've seen: rewriterule ^category/([0-9a-za-z_]+) category.php?category=$1 [nc,l]

javascript - Cannot query WebSQL in Android -

when use normal query (which works on browser) in android using code: var sql = 'select dphid dph'; var sqlparam = []; db.transaction( function querydb(tx) { tx.executesql(sql, sqlparam, function querysuccess(tx, results) { console.log(json.stringify(results.rows)); ... call other function ... } , error); } , error); function error(tx, err) { console.log("error"); console.log(json.stringify(tx)); console.log(json.stringify(err)); } it prints success (without result data): {"length":5} @ null:339 but prints outer error: {"code":0,"message":"the statement callback raised exception or statement error callback did not return false"} @ null:615 what wrong? finally solved it! i try explain can learn: the error happens because use results in other function call this: results.rows[0] this works flawl

Java Regex cant save text to string -

i trying save bolded text string. have come regex "routename?.+?routelengthkm" , according online regex tester should me want find method returning true/false. how can save bolded text string? "routes:[{ routename:dulles toll rd w; sr-28 s,routedurationinminutes:18 ,routelengthkm:21.474,routelengthmiles:13.343320854,toll:true},{ routename:frying pan rd; sr-28 s,routedurationinminutes:18 ,routelengthkm:19.437,routelengthmiles:12.077588127,toll:false} package regex; import java.util.regex.*; public class regexclass { public static void main (string args[]){ pattern p= pattern.compile("routename?.+?routelengthkm"); matcher m= p.matcher("routes:[{routename:dulles toll rd w; sr-28 s,routedurationinminutes:18,routelengthkm:21.474,routelengthmiles:13.343320854,toll:true},{routename:frying pan rd; sr-28 s,routedurationinminutes:18,routelengthkm:19.437,routelengthmiles:12.077588127,toll:false}]"); system.out.println(m.find()); }

javascript - JSON loop a multidimensional array to with node.js -

Image
having read on different methods please bear me try explain. i trying retreive data twitch api , loop user.name results array possibly inside object. using nodejs has javascript. so far when run following nice json response. var request = require('request'); request({url: 'https://api.twitch.tv/kraken/channels/twitch/follows?limit=3'}, function(err, res, json) { if (err) { throw err; } console.log(json); }); this logs same if 1 visit https://api.twitch.tv/kraken/channels/twitch/follows?limit=3 or better visualized now want select follows -> user -> name object. more so, loop every user -> name in response. i thought need convert string object tried var obj = json.parse(json); but returns first {3} objects in tree. went ahead , tried var request = require('request'); request({url: 'https://api.twitch.tv/kraken/channels/twitch/follows?limit=3'}, function(err, res

Make a variable read only, but still accessible by clients in C++? -

is there way this: class example { public: const int dontmodifyme; example() { // setup dontmodifyme.. dontmodifyme = getvaluefordontmodifyme(earliersetup); } } example ex; cout << ex.dontmodifyme; // works ex.dontmodifyme = 4 // error if dontmodifyme didn't need setup, use member initialization list. there way around doesn't require explicit getter/setter methods? something have used in past along lines of: class example { int m_thevalue; public: const int &thevalue = m_thevalue; } this allows edit value internally via m_thevalue while keeping constant interface available in "public" realm. similiar in effect of getter/setter method, doesn't require actual usage of said methods.

android - getProjection().getVisibleRegion().latLngBounds; returns 0 after onMapReady -

i trying latlngbounds visible region on device's screen after google map has been initialized. receive 0 values. guess map has not been loaded, after onmapready has been called. i've looked on better way of checking map initialization , found nothing. how ensure receive correct data? initialize map public void initmap(){ mapfragment map = (mapfragment) getfragmentmanager().findfragmentbyid(r.id.mapfragment); map.getmapasync(this); } on map ready callback @override public void onmapready(googlemap googlemap) { try { if (googlemap != null) { mgooglemap = googlemap; mgooglemap.setonmarkerclicklistener(this); mgooglemap.setoncamerachangelistener(this); mgooglemap.setonmapclicklistener(this); mgooglemap.setmaptype(googlemap.map_type_normal); search(); } } catch (exception exception) { mutility.getthemedalert(this, getresources().gets

using ffmpeg to convert gif to mp4 , output doesn't play on android -

i use following command convert gif file mp4 resulting mp4 file doesn't play in android default video player . did wrong ? there aditional steps should take produce android playable mp4 files ? $ ffmpeg -f gif -i infile.gif outfile.mp4 my test gif file : test gif file desktop played output.mp4 using vlc media player , mx player on android device played video file without error.

python - PySpark: How do I install a linux command-line tool on workers? -

i trying use linux command-line tool 'poppler' extract information pdf files. want huge amount of pdfs on several spark workers. need use popplers, not pypdf or alike. does know how install poppler on workers? know can command-line calls within python, , fetch output (or fetch generated file poppler lib), how install on each worker? im using spark 1.3.1 (databricks). thank you! the proper way install on workers when set them install other linux application. pointed out, can shell out within python. if not option whatever reason, can ship files workers using addfile method: http://spark.apache.org/docs/latest/api/python/pyspark.html#pyspark.sparkcontext.addfile note latter approach not take care of dependencies (libraries etc.).

c# - Getting GridView DataKeyNames values when Row_Editing event fires? -

the datakeynames property in gridviewemp composed of 3 fields: empid , jobnumber , courseid . retrieve value of jobnumber . so on gridview.rowediting , tried out following snippet , value of empid (the first value of datakeynames ). i'm not sure how retrieve jobnumber or courseid : protected void editgridview(object sender, gridviewediteventargs e) { string empid = gridviewemp.datakeys[e.neweditindex].value.tostring(); } i need other 2 values, not sure how. thanks. by using values instead of value this: string courseid = gridviewemp.datakeys[e.neweditindex].values[2].tostring();

ruby - Populating Rails table with seeds file - where seed data has a 'false' for intended value in a boolean column, record is not loading -

running rails 4.2, postgres 9.1 on local development machine. attempting seed table 5 rows, 5 columns on each row. 1 of columns boolean value. problem can't seem load records boolean value not true. following schema: create_table "institution_types", force: :cascade |t| t.string "institution_type" t.string "institution_code" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "ownership" t.integer "term" t.boolean "nonprofit" end in seeds.rb file have: institution_types = [ ["public 4 year", "p4", "public", 4, true], ["public 2 year", "p2", "public", 2, true], ["private 4 year profit", "r4p", "private", 4, false], ["private 2 year profit", "r2p", "private", 2, false], ["private 4

c# - Using the Global.asax -

i have read global.asax (as can tell, new asp.net) i'm wondering idea use session_end method comes global class redirect user when session has been ended? or if statements on page loads check if values null? also, how global class called? ran in background of every application or have call method class in order utilize it? to answer first question regarding redirect session_end: redirecting page on session end event to answer second question regarding how global.asax class used: what purpose of global.asax good luck!

java - Add Collection (ArrayList) to ConcurrentQueue -

i have piece of code builds arraylist of custom class type ouput of function. then, attempt addall(collection) arraylist concurrentlinkeddeque. seems happen concurrentlinkeddeque ends containing arraylist.size() of last element in arraylist. i have done various checks see if arraylist built , including proper elements, not seem see through problem. there peculiarities adding collections concurrentlinkeddeque's? can try this public class concurrentldtrial{ public static void main(string[] args) { list<integer> = new arraylist<integer>(); a.add(2); a.add(3); concurrentlinkeddeque<integer> cd = new concurrentlinkeddeque<integer>(a); system.out.println(cd); } } the output [2, 3] , expected. cast data structures appropriately custom class.

javascript - how to set This in element input without tagging ID's -

5 input type, without tagging id's; if click input prompt command appear , enter name?; after entering name how can codes jquery of "this.value = person"... <div class="lines"> <input type="text"><span>7-5</span></input> <input type="text"><span>7-6</span></input> <input type="text"><span>7-7</span></input> <input type="text"><span>7-8</span></input> <input type="text"><span>7-9</span></input> </div> then jquery are $(document).ready(function(e){ var elementthis = $("input").click(function(){ var person = prompt("please enter name:"); if (person != null) { this['input'] = person; } $(this).css("background-color","green"); }); }); please h

c - Xlib multiple display support -

i want display info via xlib, specifically: iterate displays get screen rectangle each display (relative virtual screen - x11 have concept of virtual screen on physical screens mapped, similar windows , osx?) get client area rectangle (so screen minus taskbar etc.) each display thanks. half answer: using xineramaqueryscreens() able enumerate displays , coordinates in virtual screen , sizes. how desktop size, i.e. size windows maximize to? you need read _net_desktop_geometry (also maybe _net_desktop_viewport , _net_workarea )

javascript: Why can some functions be bound and mapped and others not? -

out of curiosity: the mdn taught me how shortcut function application this: trim = function.prototype.call.bind(string.prototype.trim) join = function.prototype.call.bind(array.prototype.join) now, can map trim , not join reason. join takes ',' default argument (separator), should fine, instead uses array index: > trim = function.prototype.call.bind(string.prototype.trim) call() > [' a','b '].map(trim) ["a", "b"] > join = function.prototype.call.bind(array.prototype.join) call() > [['a','b'],['c','d']].map(join) ["a0b", "c1d"] why? also, if wanted different separator? passing bind doesn't work, since prepended existing arguments (at time 1 of elements of list on map). takes role of strings join , strings join act separators if there separate: > joins = function.prototype.call.bind(array.prototype.join,';') call() > [['a','b

boolean - Turn off Warning: Extension: Conversion from LOGICAL(4) to INTEGER(4) at (1) for gfortran? -

i intentionally casting array of boolean values integers warning: warning: extension: conversion logical(4) integer(4) @ (1) which don't want. can either (1) turn off warning in makefile? or (more favorably) (2) explicitly make cast in code compiler doesn't need worry? the code looking this: a = (b.eq.0) where a , b both size (n,1) integer arrays. b filled integers ranging 0 3 . need use type of command again later a = (b.eq.1) , need a integer array 1 if , if b requested integer, otherwise should 0 . these should act boolean values ( 1 .true. , 0 .false. ), going using them in matrix operations , summations converted floating point values (when necessary) division, logical values not optimal in circumstance. specifically, looking fastest, vectorized version of command. easy write wrapper testing elements, want vectorized operation efficiency. i compiling gfortran , whatever methods used work in ifort compiling intel compilers down road.

javascript - worldweatheronline API response error -

i trying pull weather info 'worldweatheronline' using $http call in angular factory: this.testapi = function(coords) { var deferred = $q.defer(); $http.jsonp(api_roots + '?key=9834687w634087623eg8932te&q=' + coords.latitude + ',' + coords.longitude + '&cc=yes&includelocation=yes&format=json') .then(function(response) { deferred.resolve(response.current_condition); console.log(response.current_condition); }, function(error) { deferred.reject(error); } ); return deferred.promise; }; and controller: $scope.updatelocalweather = function() { $geolocation.get().then( function(position) { $weather.testapi(position.coords).then( function(weather) { $scope.localweather = weather; $ionicslideboxdelegate.update(); } ); } ); }; and console s

Windows push notification service using Pushsharp giving Notification Failure -

var push = new pushbroker(); push.onnotificationsent += notificationsent; push.onchannelexception += channelexception; push.onserviceexception += serviceexception; push.onnotificationfailed += notificationfailed; push.ondevicesubscriptionexpired += devicesubscriptionexpired; push.ondevicesubscriptionchanged += devicesubscriptionchanged; push.onchannelcreated += channelcreated; push.onchanneldestroyed += channeldestroyed; push.registerwindowsphoneservice(); push.queuenotification(new windowsphonetoastnotification() .forendpointuri(new uri(uri)) .forosversion(windowsphonedeviceosversion.eight) .withbatchinginterval(batchinginterval.immediate) .withnavigatepath("/landingview.xaml") .withtext1("pushsharp") .withtext2("this toast")); push.stopallservices(); i using pushsharp nuget package push notifications , while passing uri c# backend code windows, getting notification failure exception. i using

php - how can I create index on the basis of column content first 4 letter? -

how can create index on basis of column content first 4 letter? for example have table having multiple fields, 1 field having name country , country name in table. rank country -------------------------- 1 qatar 2 luxembourg 3 singapore 4 brunei darussalam 5 kuwait 6 norway 7 united arab emirates 8 switzerland 9 united states 10 hong kong sar now want indexing on country field. want indexing on first 4 letter of filed data. this called "prefix" index: index(country(4)) but don't recommend it. there under 300 countries in world; may index full strings.

ffmpeg - How do I confirm if a php shell_exec was completed -

i running php script using cpanel cron jobs. script using shell_exec convert video using ffmpeg. executes script , working not sending me email. trying output of shell_exec start function in php script wanted send self email make sure getting output. for example wrote: $command = "ffmpeg -i $og_video -b 1500k -vcodec libx264 -vpre slow -vpre baseline -g 30 $mp4_video"; //execute conversion $output = shell_exec($command); echo $output; i tested email removing shell_exec , echo $command variable. send me full string in email. what trying accomplish if shell_exec executed else. how check if shell_exec completed?

html - Why is my button not being the color I'm telling it to be? -

i'm trying make button 1) red, , 2) become green upon hover/mouse over. here's html: <div id="home-button"> <button type="button" style="height: 100px; width: 400px; font-size: 45px; font-family: 'josefin sans', sans-serif; border-radius:20px" href='/'> home </button> </div> home here's css: #home-button { text-align: center; padding:10px; color: red; } #home-button:hover { background-color: green; } as can see, button neither red nor green. please tell me why target button itself #home-button button{ text-align: center; padding:10px; color: red; } #home-button:hover button{ background-color: green; } <div id="home-button"> <button type="button" style="height: 100px; width: 400px; font-size: 45px; font-family: 'josefin sans', sans-serif; border-radius:20px" href='/'> ho

angularjs - how to use isolated scope in custom directive? -

i make custom directive , want use isolated scope directive problem getting dynamic data.i pretty galde if can tell me how can data url inside directive instead,in controller. how can please guide me? here custom directive: <div my-data> </div> controller: (function () { 'use strict'; var myapp = angular.module('myapp', []) .controller('myappctrl', ['$scope', '$http', function($scope, $http) { $http.get("https://www.reddit.com/r/worldnews/new.json") .success(function (response) { $scope.names = response.data.children; }); }]) .directive('mydata', function() { return { restrict: 'a', templateurl: 'datatable.html' }; });})(); datatable.html: <ul> <li > <table width="80%" id="datatable" align="center" name="table1">

Using an escape character with a beginning wildcard in regex in c# -

below sample of email using database: 2.2|[johnnyappleseed@example.com] every line different, , may or may not email, always. trying use regular expressions information inside brackets. below have been trying use: ^\[\]$ unfortunately, every time try use it, expression isn't matching. think problem using escape characters, not sure. if not how use escape characters this, or if wrong completely, please let me know actual regex should be. close yours ^.*\[(.*)\]$ : ^ start of line .* anything \[ bracket, indicating start of email (.*) (the email), capturing group \] square bracked, indicating end of email $ end of line note regex missing .* parts match things between key characters [ , ].

How to split a continuous variable into intervals of equal length (defined number) and list the interval with cut points only in R? -

i divide set of data 4 equal size interval, e.g.: x=c(0:10) g1: [0,2.5) g2: [2.5,5) g3: [5,7.5) g4: [7.5,10] is there anyway can split data intervals of equal length (say 4 in case) , below list including min , max values: 0 2.5 5 7.5 10 thanks! you're looking cut cut(1:10, c(1, seq(2.5, 10, by=2.5)), include.lowest = t) # [1] [1,2.5] [1,2.5] (2.5,5] (2.5,5] (2.5,5] (5,7.5] (5,7.5] (7.5,10] # [9] (7.5,10] (7.5,10] # levels: [1,2.5] (2.5,5] (5,7.5] (7.5,10] if want evenly spaced breaks, use seq x <- 0:10 seq(min(x), max(x), len=5) # [1] 0.0 2.5 5.0 7.5 10.0

rank - SQL: Ranking Sections separately of a Rollup over multiple columns -

i try rollup on multiple columns , apply ranking on each stage/section of rollup process. result should following: | cola | colb | colc | rankingcriteria | ranking | |------|------|------|-----------------|---------| | - | - | - | 10 | 1 | |------|------|------|-----------------|---------| | | - | - | 10 | 1 | | b | - | - | 8 | 2 | |------|------|------|-----------------|---------| | | | - | 9 | 1 | | | b | - | 7 | 2 | | | c | - | 5 | 3 | | | d | - | 2 | 4 | |------|------|------|-----------------|---------| | b | | - | 8 | 1 | | b | c | - | 7 | 2 | | b | b | - | 2 | 3 | |------|------|------|-----------------|---------| | | | x | 7 | 1 | | | | y | 5

user interface - Android: ViewPager gets stuck in between views -

Image
i have viewpager swipes between fragments. i'm using fragmentstatepageradapter feed fragments viewpager. if user swipes left @ normal pace, , swipes right quickly, can viewpager weird state shows multiple fragments. for example, if user on fragment a, swipes left fragment b @ normal pace, , swipes right go fragment a, on screen shows both fragments & b. anybody have ideas on why happening or way prevent it? here's looks like: here's viewpager definition in xml: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <com.company.views.customactionbar android:id="@+id/customactionbar" android:layout_width="match_parent" android:layout_height="@dimen/height_actionbar" android:layout_alignparenttop="true"/> <android.support.v4.view.viewpager