Posts

Showing posts from March, 2015

.htaccess - How does PHP create new html pages? -

as many of know when creates stackoverflow question new page generated , visible in various search engines well. wondering how php code created these pages. turns out websites have 1 page, profile.php , loads data mysql database. question follows: if there 1 physical file how can url change , how google list of pages/profiles/question sites stackoverflow or facebook if there 1 actual page? look @ url page question on: http://stackoverflow.com/questions/39457314/how-does-php-create-new-html-pages there isn't physical file on server's harddrive it. there's 1 master script called "show question page". happen, in general, dynamically generated page: user clicks or otherwise surfs dynamic page webserver accepts request, , triggers rewrite on url url gets changed "friendly" url "ugly" internal one. while stackoverflow isn't written in php, if was, you'd end internally: http://stackoverflow.com/showquestion.php?id=3945

WordPress Genesis child-theme - why doesn't it pull parent css? -

i'm new genesis framework , confused it's child-themes. genesis theme has it's own theme stylesheet you're required install child-them use genesis. child-themes i've seen (ex. genesis sample http://demo.studiopress.com/genesis-sample/ ) totally recreate stylesheet. seems pointless me—can tell me missing? there best-practice way import parent style sheet , customize child styles off of it? if child theme relied on genesis style sheet, then, when genesis changes style.css (as did 2.3.0 , may future versions), update genesis (which may applied automatically depending on setup) break of site. another reason, including genesis/style.css , , your-child-theme/style.css http request (with subsequent overhead) may impact performance slightly, if not on http/2 .

java - Test Memory Efficiency Comparing Data Structures on a Large Data Set -

is there online resource can use simulate how snippet of code perform on large data set , provide me metrics? otherwise method suggest achieve this? (in case, want see how linkedlist vs arraylist perform in terms of memory usage (being able view bottlenecks on period of time amazing) on inserting list of things them read 5gb file) thanks! you can use memory profiler, oracle jdk has 2 of them visualvm , jmc you can take full gc , see how memory used looking @ total heap size. on hotspot, system.gc(); honoured default. being able view bottlenecks on period of time amazing this cpu , memory profiler designed for.

sql - How to compare temporary columns created from select in order to calculate SLA? -

this whole query have now, first part seems fine starting "y as" shows columns underlined red. have marked statements in bold shows red underline. need calculate percentage of sla not able figure out query. business hours saturday-sunday 4:30 5:30pm , mon-friday 4:30am 10:30pm. select [job_ticket].[job_ticket_id], [job_ticket].[report_date], [job_ticket].[first_response_date], [job_ticket].close_date, ,[job_ticket].last_updated, [priority_type].[priority_type_name] 'ticket_priority' , datediff(minute, report_date,first_response_date) 'time_to_accept' , sum (case when (datediff(minute,report_date,first_response_date) <= '10' ) 1 else 0 end) "sla time_to_accept status", datediff(minute,[job_ticket].[first_response_date],[job_ticket].[close_date]) 'time_to_resolve' , (case when priority_type_name='low' sum(case

type conversion - Java BigDecimal data converting to opposite sign long -

according java 7 documentation , method longvalue class java.math.bigdecimal can return result opposite sign. converts bigdecimal long. conversion analogous narrowing primitive conversion double short defined in section 5.1.3 of java™ language specification: fractional part of bigdecimal discarded, , if resulting "biginteger" big fit in long, low-order 64 bits returned. note conversion can lose information overall magnitude , precision of bigdecimal value return result opposite sign . in case possible? it possible whenever value of bigdecimal larger long can hold. example: bigdecimal num = new bigdecimal(long.max_value); system.out.println(num); // prints: 9223372036854775807 system.out.println(num.longvalue()); // prints: 9223372036854775807 num = num.add(bigdecimal.ten); // num large long system.out.println(num); // prints: 9223372036854775817 system.out.println(num.longvalue()); // prints:

apache spark - Scala: Xtream complains object not serializable -

i have following case classes defined , print out clientdata in xml format using xstream. case class address(addressline1: string, addressline2: string, city: string, provincecode: string, country: string, addresstypedesc: string) extends serializable{ } case class clientdata(title: string, firstname: string, lastname: string, addrlist:option[list[address]]) extends serializable{ } object ex1{ def main(args: array[string]){ ... ... ... // in below, x try[clientdata] val xstream = new xstream(new domdriver) newclientrecord.foreach(x=> if (x.issuccess) println(xstream.toxml(x.get))) } } and when program execute line print each clientdata in xml format, getting runtime error below. please help. exception in thread "main" org.apache.spark.sparkexception: task not serializab

PHP date_sub. can't substract today and date -

i trying output number of days between today , date enter have problem encounter error: "warning: date_diff() expects parameter 2 datetimeinterface" what's problem ? <?php $today=date("y-m-d"); $date=date_create("2016-09-16"); echo date_diff($date,$today); ?> your problem lies in when using date_diff have make sure you're comparing objects actual date objects. return type date_diff dateinterval object. you're treating string. $today = new datetime(); // $today datetime object $date = new datetime("2016-09-16"); // $date datetime object! $diff = date_diff($date,$today); // compare 2 objects of same type ftw! echo $diff->days; // $diff dateinterval object, echo it's 'days' property. // output: 3 (as of writing) further reading: http://php.net/manual/en/class.dateinterval.php http://php.net/manual/en/class.datetime.php http://php.net/manual/en/function.date-diff.php

Git for visual studio 2015, delete intermediate commit -

im new using git...while working it, have created intermediate commits in case computer crash or that, have commit history in new branch frmclients - crud operations final frmclients - crud operations tmp3 frmclients - crud operations tmp2 frmclients - crud operations tmp1 i know if there way delete intermediate commits (from tmp1 tmp3) , keep last one, didnt merge&push yet server. doing revert or hard reset wont want. or mayb im using git in wrong way? rebase friend here: git rebase -i head~4 replace second fourth lines starting "pick" "f" "fixup", , you'll end single commit.

mongoengine - MongoDB Datetimefield Null Error -

i trying save null value in datetimefield object in mongodb. have date want set after condition has been fulfilled, site has ability save object multiple time database before variable set other null or empty string value. tried using db.datetimefield(null=true) in model file per mongo's documentation save null value, still error when trying save database. according issue on github , there inconsistent behavior setting null values datetimefields . know if has been fixed? have work around (adding attribute object, assigning value right before saving, therefore bypassing need save null value, bit hacky, , use mongodb's built in functionality if possible). thanks in advance!

How to extend Laravel core class MessageBags -

i need extend illuminate\support\messagebag because of add methods i cant bind own class app\support\mymessagebag laravel use class (that extends app\support\mymessagebag) instead of original core class. do have ideas?

python - Creating a Unittest -

hey i'm pretty new python , i'm trying create unit test code , i'm running lot of trouble, honest i'm wondering if code testable. """ core employee class """ class employee(object): empcount = 0 def __init__(self, name, salary, debt, takehome): self.name = name self.salary = salary self.debt = debt self.takehome = takehome def display_employee(self): print "name : ", self.name, ",salary: ", self.salary, "debt: ", \ self.debt, "take home: ", self.takehome emp1 = employee("scott", 2000, 200, 2000-200) emp2 = employee("mary", 5000, 300, 5000-300) emp3 = employee("sam", 4000, 700, 4000-700) emp4 = employee("sarah", 7000, 2000, 7000-200) emp5 = employee("charlie", 10000, 5000, 10000-5000) emp6 = employee("tony", 16000, 20000, 16000-20000) employees = [emp1, emp2, emp3, emp4, emp5, emp6] employee in

ios - Running first React-Native app fails -

i'm trying set first react-native app. , getting attached error. following official guide: https://facebook.github.io/react-native/releases/next/docs/getting-started.html mac + ios all installations fine when running guydu@guys-macbook-pro awesomeproject $ react-native run-ios i following error: found xcode project awesomeproject.xcodeproj launching iphone 6 (8.4)... building using "xcodebuild -project awesomeproject.xcodeproj -scheme awesomeproject -destination id=5a6eae50-8d20-414b-a882-5b4560596ef7 -deriveddatapath build" user defaults command line: idederiveddatapathoverride = /users/guydu/apps/awesomeproject/ios/build === build target rctgeolocation of project rctgeolocation configuration debug === check dependencies write auxiliary files /bin/mkdir -p /users/guydu/apps/awesomeproject/ios/build/build/intermediates/rctgeolocation.build/debug-iphonesimulator/rctgeolocation.build write-file /users/guydu/apps/awesomeproject/ios/build/build/intermedi

multithreading - How to guarantee the order of function calls in PHP? -

i want implement php service 2 c# applications involved, each application reads output of previous application , generates output. wondering if can implemented line line, rather requiring threads or other asynchronous mechanism. users can upload text file in this webpage , leads uploadfile.php , written follows: <?php copy($_files["file"]["tmp_name"], "uploads/" . $_files["file"]["name"]); $n1 = "uploads/" . $_files["file"]["name"]; echo "uploaded: " . $n1 . "<br>"; exec("mono c1.exe $n1"); echo "after running c1.exe"; $n2 ="uploads/c1_" . $_files["file"]["name"]; exec("mono c2.exe $n2"); echo "after running c2.exe"; ?> assume user uploads test.txt in webpage, c1.exe uses content of test.txt , generates c1_test.txt , c2.exe uses content of c1_test.txt , generates c2_test.txt . my tests (by

Can't Get PHPMyAdmin to recognize configuration file after update(Keep getting blowfish_secret too short error) -

i updated phpmyadmin via command line (i added ppa manually). keep getting error says "the secret passphrase in configuration (blowfish_secret) short. have created own config.inc.php file in /etc/phpmyadmin using command sudo cp config.sample.inc.php config.inc.php in file (my config.inc.php) have set $cfg['blowfish_secret'] = 'we(g|]=vpxy}uddlc8[sc1j8y$yeleu]7#_#*1fdas;doifje'; and restarted server sudo service apache2 restart i restarted mysql server with sudo service mysql restart i still getting error telling me blowfish_secret key short. (yes, have tried setting key 32 characters well. did not work either) have refreshed page, cleared cache. tried setting permissions 7 sudo chmod -r 777 phpmyadmin (just see if work. don't kill me being desperate xd) still, no avail. ideas? as turns out, had edit /var/lib/phpmyadmin/blowfish_secret.inc.php just put 32 (or more) random characters between single quotes, so $cfg['blo

excel vba - VBA transferring data to another workbook with major adjustments - doable? -

i have move large amount of data workbook workbook b in excel - workbook has different organizational structure workbook b, , want automate transfer b , organize b's structure. i'm getting acquainted vba, before potentially wasting lot of time - vba can do? definitely, long have reliable set of steps translating information 1 format another. if that's case, can codified , implemented in vba.

nexus - Unable to publish to an NPM Registry (local) -

Image
i running nexus 3.0.1-01, , using host both maven repositories , npm registries. npm, have local mirror of npmjs.org, local npm registry , group combines two... i have been using npm internally, can use npm-public group registry , has been working fine. so, can use nexus mirror npmjs. the next step take locally written npm modules , publish them npm-releases (on nexus instance) these modules can shared amongst delivery teams here. i've been able build out package, , npm pack seems behave. i have run npm adduser provide nexus credentials npm environment. using same username/password use when log nexus web app, , user assigned admin role (so should have permissions). can see credentials in .npmrc file my registry value still npm-public group combined mirror , local registry. have ensured package.json of module attempting deploy has "publishconfig" section points url of local registry (not public group) however, despite of that, calling "npm p

web - Prefix to domain -

if have domain, such example.com , how go pointing special.example.com different website, www.google.com ? go domain name service providers web console (the place managing domain records mydomain.com ), , add cname record: special cname www.google.com keep in mind point special.mydomain.com ip address of www.google.com not guarantee web server there respond requests host: special.mydomain.com (though will). (btw, domain use in questions/examples/documentation not mydomain.com example.com , specified rfc2606 )

using htonl() to properly convert localhost using C++ -

i have define following: #define localhost 2130706433 i'm trying correct network/host bytes order when working sockaddr_in : struct sockaddr_in src; src.sin_port = htons(0); src.sin_family = af_inet; src.sin_addr.s_addr = htonl( localhost ); this seems ordering incorrectly i'm seeing 1.0.0.127 if print src.sin_addr.s_addr stdout. what's right way of doing this? 2130706433 in decimal 0x7f000001 in hexadecimal, 127.0.0.1 in network byte order. if you're using htonl() on intel x86 platform, since x86 little-endian, htonl() ends reversing bits.

scala - Persistence in Scalatra -

i writing web app angularjs front-end , scalatra back-end. have followed tutorial on adding persistence using slick , h2: http://www.scalatra.org/2.4/guides/persistence/slick.html i want know how have data in database persist if restart servlet.

r - Using Rscript to create graphs from command line -

Image
is possible generate pdfs/pngs of graphs directly command line using r? i attempted command: rscript -e 'pdf(\'graph.pdf\');plot(c(1,2,3,4,5));dev.off()' which executes, no file generated. works here: edd@max:~$ mkdir /tmp/demo edd@max:~$ cd /tmp/demo edd@max:/tmp/demo$ rscript -e 'pdf("foo.pdf"); \ plot(cumsum(rnorm(100)), type="l"); \ dev.off()' null device 1 edd@max:/tmp/demo$ ls -l total 8 -rw-rw-r-- 1 edd edd 5132 sep 12 19:36 foo.pdf edd@max:/tmp/demo$ the chart (converted png inclusion here) below.

c# - VSTO outlook plugin not showing in Microsoft Office Outlook 2007 -

i have developed 1 plugin microsoft office outlook. used following tools develop plugin. visual studio 2012 office add-ins -> outlook 2013 add-in template. generated exe using "installshield limited edition project" it working fine office 2013 , 2016. not working in office 2007 outlook. i have tried install in following environments: windows 7 64bit os , microsoft outlook 2013 ( installation successful , outlook plugin visible ) windows 7 32bit os , microsoft outlook 2016 ( installation successful , outlook plugin visible ) windows7 32bit os , microsoft outlook 2007 ( installation successful not outlook plugin visible )

c# - Using ADO.Net, how do I get the database table name associated with a DataColumn? -

assume have table t1 column c1. when execute 'select c1 t1', can metadata result using datatable/datarow/datacolumn using code snippet below namespace consoleapplication1 { internal class program { private static void main(string[] args) { sqldataadapter adapter; dataset dataset = new dataset(); using (sqlconnection connection = new sqlconnection(@"persist security info=false;trusted_connection=true;")) { sqlcommand command = new sqlcommand( @"select c1 t1 1 = 0;", connection); connection.open(); sqldatareader reader = command.executereader(); datatable schematable = reader.getschematable(); console.writeline(reader.getname(0)); //name of column foreach (datarow row in schematable.rows) { //console.writeline(row[&

How to create a list of x elements counting by 2 in Python -

i'm taking introductory python course, question might pretty easy of all. assignment i'm working on introducing lists. given variable b2 = 5 , tasked using b2 create list c2 such c2 = [0, 2, 4, 6, 8] has b2 number of elements , counts 2. how this? lets break down problem. first let cover how lists created in python. #will create list variable c2 = [] each list variable has append method can readily use. in event need add first element list, append list contains no values. c2.append(value) the thing is, problem want automatically increment counter , place new value, without having hard code each value list. how solve problem if decide hardcode. c2.append(0) c2.append(2) c2.append(4) c2.append(6) c2.append(8) now reason question gives value b2 = 5 because limit, want loop, increment counter value of 2 until have incremented counter 2 5 times. increment of counter can done such: b2 = 0 b2 =+ 2 #or numerical value increment #b2's new value 2 if pri

angularjs - Accessing value in sub nested object in JSON with Angular -

Image
i'm trying access values in sub array objects of results: results: [ { list_name: "e-book fiction", display_name: "e-book fiction", bestsellers_date: "2016-09-03", published_date: "2016-09-18", rank: 1, rank_last_week: 0, weeks_on_list: 1, asterisk: 0, dagger: 0, amazon_product_url: "http://rads.stackoverflow.com/amzn/click/1250022134", isbns: [], book_details: [ { title: "a great reckoning", description: "an instructor @ police academy found murdered, perhaps 1 of cadets favored armand gamache, retired homicide chief of sûreté du québec.", contributor: "by louise penny", author: "louise penny", contributor_note: "", price: 0, age_group: "", publisher: "minotaur", primary_isbn13: "9781250022127", primary_isbn10: "1250

optaplanner - Brute Force Solver Configuration for multiple entity classes -

i'm running following issue while trying configure solver brute_force multiple entity classes: caused by: com.thoughtworks.xstream.converters.reflection.abstractreflectionconverter$duplicatefieldexception: duplicate field entityselectorconfig following configuration: <solver> ... <exhaustivesearch> <exhaustivesearchtype>brute_force</exhaustivesearchtype> <entityselector> <entityclass>planningentity_classa</entityclass> </entityselector> <entityselector> <entityclass>planningentity_classb</entityclass> </entityselector> </exhaustivesearch> </solver> this configuration works fine if single entity specified. if no entity specified, following exception: the phaseconfig (exhaustivesearchphaseconfig) has no entityselector configured , because there multiple in entityclassset ...

jquery - How to change active bootstrap tab with javascript -

i have tried change active tab , failed use javascript onclick element correctly. here's code: <ul class="nav nav-tabs" style="text-align: left;"> <li class="active"><a href="#first" data-toggle="tab">first</a></li> <li><a href="#second" data-toggle="tab">second</a></li> <li><a href="#third" data-toggle="tab">third</a></li> </ul> <div class=“tab-content"> <div id="first" class="tab-pane fade in active”> text <a href="#second" class="btn btn-primary btn-lg" onclick=“change active tab second” data-toggle="tab">second</a> <a href="#third" class="btn btn-primary btn-lg" onclick=“change active tab third” data-toggle=“tab">third</a> </div> <div id="second" class=&q

itunesconnect - iOS new build in Xcode 8 GM not found in iTunesconnection -

Image
i can't find newly uploaded build in itunesconnect when click "select version test" testflight. when tried upload again, xcode shows: but find binary? , how select newly uploaded build beta testing testflight? thanks. for why can't find newly upload versions: check email.and app store review send email lack of user usage description . add key , string value info.plist app store review ask. and why can't upload binary file again: there 1.0.20 existed in itune connect. need let version +1. such 1.0.21. and every time try upload new version, must make version greater latest version in itune connect. then archive , upload again. good luck!

html - How can i center align two divs? -

how can align 2 inline divs adjacent edges center? so i'd this: div1div1 div2div2 div1 div2 div1div1div1 div2div2 i tried using inline block like below merely centering each line. .container { text-align: center; } .left-div { display: inline-block; } .right-div { display: inline-block; } <div class="container"> <div class="left-div">div1div1</div> <div class="right-div">div2div2</div> </div> <div class="container"> <div class="left-div">div1</div> <div class="right-div">div2</div> </div> <div class="container"> <div class="left-div">div1div1div1</div> <div class="right-div">div2div2</div> </div> https://jsfiddle.net/fkfmh7md/ change distance between divs, change 5px in padding:0 5px other value .con

php - how to compare values in array in while loop -

my while loop condition looks this: while ($currentmodif <= $lastmodif) { .....thing done } now instead of comparing between 2 values, compare between array , string. the array this: array(2) { [0]=> array(2) { ["time"]=> int(1473735528) ["id"]=> string(1) "3" } [1]=> array(2) { ["time"]=> int(1473507326) ["id"]=> string(1) "4" } } and $lastmodif = 1473503210; so how compare if value of key called time in given array greater $lastmodif in while loop? to expand on @siddhesh's comment, foreach loop through array fine. foreach($yourarray $item) { if($item['time'] <= $lastmodif) { // work } } this loop goes through array , giving copy of each item. if want modify items, need use reference: foreach($yourarray &$item) { // <-- notice & if($item['time'] <= $lastmodif) { /

f# remove from own user defined list -

i want create function removes occurrence of integer n , returns list. know how want not know command delete it. here data type type alist = | l of int * alist here's how data type looks: let l = l(2, l(1, l(2, l(7, l(3, l(2, a)))))) remove 2 l;; should return l = l(1, l(7, l(3, a))) here have far: let rec remove n l = match (n, l) | (n, a) -> l | (n, l(head,tail)) when (n = head) -> i don't know how how rid of list or element. you shouldn't thinking in terms of "deleting" list; should instead think in terms of building new list, without element want removed. i'll show how in minute, first want make suggestion. in match expression, re-using name n in patterns. that's classic beginner's mistake, because ends confusing you. once know f# pretty well, that's valid technique, since appear beginner, suggest not doing that. instead, use name in patterns different name of thing you're

Query multiple facebook posts insights -

i'm querying post's insights with /$postid/insights/post_impressions,post_impressions_unique but if want have insights of multiple posts, there way achieve single api call? i've found can query insights of multiple posts request like /insights/post_impressions,post_impressions_unique?<id1>,<id2>,<id3>... however can reach url length limit requests, if knows post version works better

angular 2 missing domsanitizer when try to start -

im running angular2 rc 5 doing fine until im restart pc , doing npm start again, before restart pc working fine when im try start project again there error saying , node_modules/@angular/platform-browser/index has no exported member 'domsanitizer' im try reinstall package , copy paste @angular file quickstart working still fail same error i guess wrong @angular/platform-browser still cant figure out if using angular2 rc5 use this- domsanitizationservice if moving angular2 rc6 use this- domsanitizer reference: https://github.com/angular/angular/pull/11085 see if helps.

security - Should I prevent password autocomplete? -

there lots of replies here on how prevent password form element autocomplete. question should we? according uk government ; forcing password resets (something we're asked clients) describes net-loss in security , it's actively discouraged. according mozilla ; forcing password autocomplete off also suggests net-loss in security . uk .gov website doesn't mention particular practice. my question: should attempt prevent password autocomplete, forcing user remember password, or autocomplete provide net-gain? // please cite sources. the classic risk of allowing password autocomplete xss flaw on website allow attacker grab password. because browser autocomplete password field value, available in dom. <script> new image().src = "//evil.example.com/?password=" + escape(document.getelementbyid('password').value); </script> however, if attacker can inject password field in xss attack, inject 1 autocomplete enabled anyw

ruby - Boot up rails app, make request to app from outside local network -

i'm sure pretty basic question, not find answer it. looked @ this question , this question , this question , this question , , this question , none of them helped me reach answer. i using rails 4.2 . created simple app test out if following: i wanted see if possible me boot rails app on computer, , access app outside of local network. example: phone (which not connected local network) want make request , response. i assumed first needed external/routable ip address. realize ip address isp provides router not static, demo purposes wanted see if make single request. i went google , typed in "what ip" , came external ip address (let's pretend external ip address is: 11.111.111.111 ). within rails app: did following command: rvmsudo rails s -p 80 -b 11.111.111.111 i want bind external ip address, , want listen on port 80. rvmsudo because, understand it, ports below 1000 require higher privileges. it errors out , says following: can't as

php cant find class if file name starts with a capital B -

i'm having trouble confusing error. have class , extended class. if extended file name starts capital b cannot find database class. if name else, literally else works. my database class looks so class database { public $db; public function __construct() { if (database == true) { $this->db = new mysqli(hostname, username, password, dbname); if ($this->db->connect_error) { exit('some of database login credentials seem wrong.' . '-' . $this->db->connect_error); } } } } my extended class so class blogmodel extends database { public function getblogposts() { $query = array(); if ($result = $this->db->query('select * blog')) { while ($row = $result->fetch_assoc()) { $query[] = $row; } $result->free(); } ret

javascript - How to find the coordinates value of all the points which divides the line into 5 equal parts -

how divide line n equal parts, eg- 5 equal parts. for example need add 5 points on straight line based on starting , ending point xy co-ordinates given below: starting point : x1 : 0.27176220806794055 y2 : 0.7258064516129032 ending point x1 : 0.6303191489361702 y2 : 0.348993288590604 how find coordinates value of points divides line 5 equal parts. divide distance between start , end points 5 each component separately, , use compute interior points: function divideintofivesegments(startpoint, endpoint) { let {x: x1, y: y1} = startpoint; let {x: x2, y: y2} = endpoint; let dx = (x2 - x1) / 5; let dy = (y2 - y1) / 5; let interiorpoints = []; (let = 1; < 5; i++) interiorpoints.push({x: x1 + i*dx, y: y1 + i*dy}); return [startpoint, ...interiorpoints, endpoint]; } this returns array of 6 points (2 end points + 4 interior points), defines line 5 segments. you can call function this: divideintofivesegments({x: 0.2717622

javascript - How to do paging in MithrilJS? -

i have dataset of 50 items in-memory , attempting create pager dataset, i'm unsure how this. i'm using custom filter function filter results, , works fine, somehow need number of pages out. any clues? mithril infinite versatile mithril component handling potentially large collections of items. it's primary purpose potentially infinite scrolling list, github pages features a pagination demo . pagination shouldn't difficulty per se. @ simplest pagination requires stateful index indicating page display, , method splitting list sub-lists represent pages. the key reducer function create list of pages out of our initial list of items: // empty collection of pages first argument. // function executes once each item in provided list foreach & map. function paginate( pages, item, index ){ // modulo (%) remainder of x after division y // result of 0 means multiple. // if pagelength 6, create new page @ 0, 6, 12, 18, etc... if( index % pageleng

graph - How to speed up Two Hop query in TitanDB with Cassandra -

i testing titandb + cassandra now. graph schema this: vertex: user(userid), ip(ip), session_id(sessionid), device(deviceid) edge: user->ip, user->session_id, user->device data size: vertex 100million, edge: 1 billion index: vertex-centric index on kinds of edge . index userid, ip, sessionid, , deviceid. set vertext partition ip, device , session_id. total 32 partition. cassandra hosts:aws ec2 i2 (2xlage) x 24 . currently, every host hold 30g data. usecase: give userid edgelabel, find out related users edge's out vertex. example: g.v().has(t.label, 'user').has('user_id', '12345').out('user_ip').in().valuemap(); but kinds of query pretty slow, sometimes, hundreds seconds. 1 user can have many related ip (hundreds), these ips, can lots of users (thousands). does titan parallel query kind of query against partition of backend storage?? try use limit: g.v().has(t.label, 'user').has('user_id', '12345&