Posts

Showing posts from May, 2015

java - RxJava- CombineLatest but only fire for one Observable's emission? -

let's have 2 infinite observables can emit values @ moment. combine create observable<processfileevent> . observable<integer> selectedfileid= ... observable<mouseclick> buttonclick = ... observable<processfileevent> `processfileevent` = observable.combinelatest(selectedfileid, buttonclick, (s,b) -> { //create processfileevent here }); the problem want processfileevent emit when buttonclick emits something, not selectedfileid . it's not behavior user expects when file id inputted , kicks off processfileevent . how combine emit when buttonclick emits? use .distinctuntilchanged() on mouseclick object. way you'll events when mouseclick changes. create class contains both fileid , mouseclick : static class filemouseclick { final int fileid; final mouseclick mouseclick; filemouseclick(int fileid, mouseclick mouseclick) { this.fileid = fileid; this.mouseclick = mouseclick; } } then obs...

java - How can I set the name of markers inside a cluster manager using a list? -

so have around 850 markers have on map, , have implemented cluster manager successfully, can't seem figure out how can set each marker's title (which have kept in list). have tried below code, of marker's title's set first item in list. thoughts? jacob here code i've tried (where universityname list) mclustermanager.getmarkercollection().setonmarkerclicklistener(new googlemap.onmarkerclicklistener() { @override public boolean onmarkerclick(marker marker) { for(int = 0; < 835; i++) { marker.settitle(universityname.get(i)); } return false; } }); here myclass: class myitem implements clusteritem { private final latlng mposition; public myitem(double lat, double lng) { mposition = new latlng(lat, lng); } @override public latlng getposition() { return mposition; ...

sql - Same Data, two different results -

i have sql call gets data year , displays in month month breakdown per code below. select materialcode, [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12] (select mb.materialcode, datepart(m, date) [dp], weight issues iss join materialbatches mb on iss.materialbatchid = mb.id left join materials m on mb.materialcode = m.code issuetype = 'materialissue' , datepart(yyyy,date) = 2013 , weight > 0 , (coalesce(m.isnondispensematerial,0) = 0 or cast((select value configurationsettings name = 'includenondispenseweights') varchar(10)) = 'true')) pivot (sum(weight) i.dp in ( [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12] )) pvt this code needs change make starting selected month changeable. using code below 948 more records \ row back. select code, [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12] (select mb.code, datepart(m, date) [dp], weight issues iss join batches mb on iss.id = mb.id left join mats m on mb.code...

Can you use a Mule ESB Collection Splitter to on a HashMap? -

can use collection splitter split hashmap resulting in messages identified key , containing value in payload? example, have map<string, list<object>> , , process each list differently based on key. if possible, i'm assuming list mapped payload, how key mapped resulting message? message header? you split on entry set of hash map. i.e use following split expression #[maymap.entryset()] please see javadoc method understand how key , value each entry.

vanilla JavaScript solution to check if number has no more than 6 digits and 2 decimal places -

i need return validation check (boolean) if number has no more 6 number of digits , no more 2 decimal places. for example: 1 = valid 10 = valid 111111 = valid 111111.11 = valid 1111111.11 = invalid 1.111 = invalid looking through stack overflow can find answers input automatically rounded (not want) or decimal places have equal 2 decimal places (not @ 2). obviously, need function valid(n) { return no_more_than_six_digits(n) && no_more_than_two_decimal_places(n); } so how define these functions? function no_more_than_six_digits (n) { return n < 1e7; } function no_more_than_two_decimal_places(n) { return math.floor(n * 100) === n * 100; }

ruby - Rails test can't find route when it clearly exists? -

okay, tired, , new rails possibly missing super basic. anyways, started new project , implementing controller static pages. wrote unit tests make sure routes correct (there 4 far). 3 of them pass fourth gives me error message: 1) error: staticpagescontrollertest#test_terms_of_service_should_return_success: actioncontroller::urlgenerationerror: no route matches {:action=>"terms", :controller=>"static_pages "} test/controllers/static_pages_controller_test.rb:18:in `block in <class:staticpagescontrollertes t>' its saying can't find route. however, when rake routes exists: /about(.:format) static_pages#about contact /contact(.:format) static_pages#contact privacy /privacy(.:format) static_pages#privacy terms /terms(.:format) static_pages#terms_of_service here part of routes.rb: 'about' => 'static_pages#about' 'contact' => 'static_pages#contact' 'privacy' => ...

Rails 4 has_many :through accessing field on join table -

i have 3 models: class user < activerecord::base has_many :user_leave_portfolios has_many :leave_portfolios, :through => :user_leave_portfolios end class leaveportfolio < activerecord::base has_many :user_leave_portfolios, dependent: :destroy has_many :users, :through => :user_leave_portfolios end class userleaveportfolio < activerecord::base belongs_to :user belongs_to :leave_portfolio # table has additional field named 'leave_amount' end the 'leave_amount' field on user_leave_portfolio table used user chosen leave amount based on leave_portfolio according documentation , various other blogs , articles, should able access 'leave amount' field with: u = user.first u.leave_portfolios.first.leave_amount however, following error: nomethoderror: undefined method `leave_amount' #leaveportfolio:0x007f8708e3dbe0 schema: create_table "leave_portfolios", force: :cascade |t| t.string "name...

jquery - slide navigation to the center vertically on screen -

i developing website using scrolling parallax, 1 long website page, divided slides. the first slide fit on screen main menu menus: us, contact , on rest of slides fit on screen. if want click about us website can smooth scroll navigate belowthe first slide , should navigate center on targeted element , vertically centered on screen. the html is <a href="#aboutuscontents" class="active" title="next section" >slide 1</a> and think on line on jquery: var targetoffset = $target.offset().top i'm not sure is responsible that, don't know how center because no center available top , left the problem is, when navigating, topmost part of element stick edge of top of screen using targetoffset.| to link: jquery - scroll element middle of screen instead of top anchor link same problem , link states problem is, , in line offset = eloffset - ((windowheight / 2) - (elheight / 2)); answers question. thank you

javascript - callback called even after off? -

i have situation if call off on reference keeps calling callbacks? var ref = new firebase('https://stackoverflow.firebaseio.com/31069762'); (var n = 0; n < 1024; ++n) { ref.push(n) } ref.on('child_added', function(snapshot) { if (snapshot.val() > 10) { console.log('off') // printed multiple times. ref.off(); } }); when call off() stop firebase client firing child_added events new data comes in. not prevent firing child_added events data client received. you can interesting behavior way. example, snippet: var ref = new firebase('https://stackoverflow.firebaseio.com/31069762'); ref.remove(); (var n = 0; n < 1024; ++n) { ref.push(n) } ref.on('child_added', function(snapshot) { console.log(snapshot.val()); if (snapshot.val() > 10) { console.log('off') // printed multiple times. ref.off(); } }); will print: 1 2 . . . 11 "off" 12 "off" . . . 1024 ...

cucumber - Conditional Inputs? -

i'm trying write cucumber test part of our application (i'm new cucumber, , writing acceptance tests really), , have step in test, want 1 of 2 different things. want either check specific value, or check system default value. this came with scenario outline: english news given locale set '<language>' when user views page see <image> image examples: | language | image | | en-gb | default | | fr | "french.png" | this hits 1 of 2 different step definitions, @and("^they see default image$") public void defaultimage() throws throwable { // check system default } @and("^they see \"(.*)\" image$") public void customimage(string image) throws throwable { // check specific value input } is correct way this? tl has suggested should have 1 step def, , pass "default" input, , conditional check inside step def, this: @and("^they see \"(.*)\" image$...

html - Windows phone: Disadvantages on table rendering -

i want convert td's tr's in responsive design. i tried display:block, float:left, width:100% within media queries. () it working expected in android devices. but windows phone not supporting in version. how make working windows mobile?

powerpoint - How can I convert reveal.js to ppt not pdf? -

i made presentation reveal.js. my boss asked ppt format modify , add contents presentation. not sw programmer , can use powerpoint only. is there way convert reveal.js ppt? you first convert pdf , use other service convert pdf ppt. there many sites providing services convert pdf ppt include adobe itself. of them free need register. try of them find best service needs.

Android Studio not starting on Linux (CentOS 6.6) -

i'm trying run android studio on centos 6.6. i've downloaded studio , per instructions when move directory /android-studio/bin/ , run following command ./studio.sh i got following exception [root@localhost bin]# ./studio.sh no protocol specified start failed: internal error. please report https://code.google.com/p/android/issues java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ com.intellij.ide.bootstrap.main(bootstrap.java:39) @ com.intellij.idea.main.main(main.java:83) caused by: java.lang.internalerror: can't connect x11 window server using ':0.0' value of display variable. @ sun.awt.x11graphicsenvironment.initdisplay(native method) @ sun.awt.x11graphicsenvironment.access$200(x11gr...

javascript - Testing a directive in angular -

i have directive in angular dynamically creates 5 buttons. writing unit tests , decided write 1 tests if buttons present. cannot seem test pass. here of code. test.js: beforeeach(inject(function($compile,$rootscope,$location,$httpbackend,$route) { location = $location; scope = $rootscope.$new(); route = $route; $httpbackend.whenget('partials/options/options-skeleton.html') .respond(200); elm = angular.element("<options></options>"); httpbackend = $httpbackend; $compile(elm)(scope); scope.$digest(); })); describe('initial value test', function(){ it('should have 5 buttons', function(){ var options = elm.find('div'); var innerelm = options.find('div'); expect(innerelm.length).to.equal(5); }); }); directive html: <div class="row row-100" style=";margin-bottom: 20px"> <div style="" c...

matlab - Efficient Multiplication of Matrices with Large Numbers of Zeroes -

i have 2 arrays take following form: 0…0…0 0 0 0…0 0…0…0 0 0 0…0 ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ 0…0 0 0 0 0…0 0…0 0 0 0 0…0 = 0…0 1 2 3 0…0 b = 0…0 9 8 7 0…0 0…0 4 5 6 0…0 0…0 6 5 4 0…0 0…0 0 0 0 0…0 0…0 0 0 0 0…0 ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ 0…0…0 0 0 0…0 0…0…0 0 0 0…0 the size of non-zero areas of a , b may not same, diagram above getting bit unwieldy. ultimately, value i'm after sum(sum(a .* b)) . feel there must way multiply non-zero elements, every approach can come seems cause matlab make copy of matrix, utterly destroys gains made reducing number of operations. b reused several iterations of inner loop, can amortize expensive calculations on b on many loop iterations. i've tried following approaches far: naive approach: function c = innerloop(a, b) c = sum(sum(a .* b)) end innerloop takes 4.3 seconds on 86,000 calls using this. (based on matlab's "r...

Installing and using Google's PHP library for OAuth 2 -

in order post/upload stuff local php script (running on machine) (my) gae app, doing this: https://developers.google.com/api-client-library/php/start/installation i installed library locally in same folder use uploading php script, using composer. installation works fine, don't understand need able use google_client() class etc in script. "setting include_path dynamically in code" not , steps include library seems missing. some background info: used able upload/post fine gae app getting "sacsid" cookies, until of these reasons: i enabled two-step verification on account used access admin of gae app google deprecated "sacsid" process. i might wrong stuff guess official way these days use said php library right? specifically tried @ top of script: require_once 'vendor/autoload.php'; and get fatal error: class 'google\appengine\api\app_identity\appidentityservice' not found in /vendor/google/apiclient/src/g...

javascript - Create unique id per iteration, then specify behavior when clicked -

i have html.erb file i'm creating new row iterate on collection. need able dynamically create id per row, , able specify id in .js file can show/hide of contents when clicked. #foo.html.erb file <table> <thead> <tr> <th> group name </th> <th>&nbsp;&nbsp;</th> <th> count </th> </tr> </thead> <tbody> <% @groups.each |group_name, count_for_group| %> <tr id="unique_id"> #create unique id here <td> <%= group_name %> </td> <td> </td> <td> <%= count_for_group %> </td> #this should hidden. if row data belongs clicked, show it. if clicked again, hide it. </tr> <% end %> </tbody> </table> and need able show/hide group's count when clicked, don't know how find id dynamically created: #app/assets/javascripts/test.js $(docu...

html - Custom style for input with CSS -

Image
i have design input this: but style, can't that. my css: input.custom[type=text]{ border: none; border-bottom: 1px solid #00cccb; } .custom::-webkit-input-placeholder { color: #727272; } .custom:-moz-placeholder { /* firefox 18- */ color: #727272; } .custom::-moz-placeholder { /* firefox 19+ */ color: #727272; } .custom:-ms-input-placeholder { color: #727272; } my html: <input type="text" class="custom" placeholder="text goes here"/> results: how can style input bottom border and tiny left, right borders , in design? you can wrap input in span , style :before , :after on accordingly. need use span input s replaced elements, without psuedo elements can style. input { border: none; border-bottom: 1px solid #00cccb; padding: 0 10px; color: #727272; font-size: 20px; vertical-align: baseline; } input:focus { outline: none; } span { position: rela...

dictionary - SWIFT dictionaries - Accessing a single value of a key with multiple values -

to access second value of second key of dictionary bellow: this question not getting value of key, specific value if value array. for following variable var dict2 = ["key1" : "value1", "key2" : [ "value1" , "value2" ]] this works (option 1) let value2 = dict2["key2"]?[1] as? string println(value2!) but not (option2) let value2 = dict2["key2"][1] other users suggested second option, not work. wandering why. why should cast type? imagine if value int have cast int. assumes know type of value in there , exists. why calling optional? since dictionary has different types values, have anyobject type of value. you'll want cast type. also, dictionary accesses return optionals since key might not present in dictionary, you'll need unwrap value access it. finally, value array, use array index ( 1 access second item since array indices 0 based). here concrete example: let dict ...

javascript - Adding a counter ID to a setInterval loop -

i'm working 3 functions: startbubblemachine() starts process of making bubbles makebubble() makes bubble bubbleid identify it. appends div. killbubble() removes bubble the timings creation of bubbles randomised using function randomint generates random int within range. i'm struggling incrementing of bubbleid , needed create new bubble , ensure correct bubble destroyed. cannot work out @ stage increment. function startbubblemachine(){ console.log('starting bubble machine'); var bubbleid = 1; setinterval(makebubble(bubbleid), randomint(6000, 1000)); } this function pretty simple. initialises bubbleid and sets interval between 1s , 6s call makebubble() , passing bubbleid this stuck function makebubble(bubbleid){ console.log('making bubble number '+bubbleid); $('.wrapper').append('<div class="db-bubble db-bubble-'+bubbleid+'></div>'); killbubble(b...

android - How to get datepicker properties from dialogfragment -

hello have code public class datetimepicker extends android.support.v4.app.dialogfragment { public interface datetimepickerlistener { // public void ondialogpositiveclick(dialogfragment dialog); // public void ondialognegativeclick(dialogfragment dialog); public void ondialogpositiveclick(android.app.dialogfragment dialog); public void ondialognegativeclick(android.app.dialogfragment dialog); } // use instance of interface deliver action events datetimepickerlistener mlistener; datepicker dp; timepicker tp; int year; @override public dialog oncreatedialog(bundle savedinstancestate) { alertdialog.builder builder = new alertdialog.builder(getactivity()); // layout inflater layoutinflater inflater = getactivity().getlayoutinflater(); dp = (datepicker) this.getactivity().findviewbyid(r.id.date_picker); // tp = (timepicker) this.getview().findviewbyid(r.id.time_picker); // inflate , ...

How to create backup of ms access using c# code? -

private void backup() { string dbfilename = "clients.accdb"; string currentdatabasepath = path.combine(environment.currentdirectory, dbfilename); string backtimestamp = path.getfilenamewithoutextension(dbfilename) + path.getextension(dbfilename); string destfilename = backtimestamp + dbfilename; folderbrowserdialog fbd = new folderbrowserdialog(); if (fbd.showdialog() == dialogresult.ok) { string pathtobackup = fbd.selectedpath.tostring(); destfilename = path.combine(pathtobackup, destfilename); file.copy(currentdatabasepath, destfilename, true); messagebox.show("successful backup! "); } } my database in d drive, have method backup ms access database, not taking backup when add data in database.

store data in Session using AngularJS -

i learning angularjs creating small application. i storing user information in sessionstorage @ time of successful login. logincontroller.js app.controller("logincntrl", function ($scope, $location, angularservice) { $scope.login = function () { var username = $scope.username; var password = $scope.password; var getdata = angularservice.logininformation(username,password); getdata.then(function (msg) { if (msg.data == '') { alert('no data'); } else { sessionstorage.username = msg.datausername; $location.path('/members'); } }, function (error) { alert('error in login'); }); }; }); on successful login, redirecting user '/memberlist' , in memberlistcntrl controller checking if sessionstorage empty or not. if empty assume user trying access site without login , sending user l...

gmail - Stay signed in Google across browser restarts via SSO (single-sign-on)? -

is there way stay signed in google accounts across browser restarts if credentials managed through sso identity provider? after each browser restart redirects single-sign-on site (e.g. okta) requires enter password site. https://support.google.com/a/answer/4421331?hl=en says "the stay signed in checkbox selected default" doesn't seem "selected default" if don't password page. see https://community.okta.com/thread/2200 there 2 distinct questions here. first 1 deals identity providers (idp) okta , way works depends on several configuration settings , other factors. in general, if user has authenticated saml idp (e.g., okta), still has valid session and service provider (i.e., google) has been configured redirect sign-on requests, okta can generate saml response, pass google , user gain access protected resource (i.e., google app) without being challenged login again regardless of whether browser restarted. okta developer guide describes p...

python - iPython notebook error when trying to load matplotlib -

i'm trying learn pandas watching video: https://www.youtube.com/watch?v=5jnmutdy6fw . downloaded notebooks ( https://github.com/brandon-rhodes/pycon-pandas-tutorial/ ), , loaded exercises-1. first block %matplotlib inline import pandas pd is giving me error: --------------------------------------------------------------------------- importerror traceback (most recent call last) <ipython-input-10-5761ac74df30> in <module>() ----> 1 get_ipython().magic(u'matplotlib inline') 2 import pandas pd /users/***/anaconda/lib/python2.7/site-packages/ipython/core/interactiveshell.pyc in magic(self, arg_s) 2305 magic_name, _, magic_arg_s = arg_s.partition(' ') 2306 magic_name = magic_name.lstrip(prefilter.esc_magic) -> 2307 return self.run_line_magic(magic_name, magic_arg_s) 2308 2309 #------------------------------------------------------------------------- /users/***/anaco...

css - Is it possible to use bootstrap to have different sized rows per column? if so, how? -

so in situation have 4 divs. 2 divs need on right side of screen, , 2 need on left side. cannot bundle 2 on each side within div because when responsive in mobile view positioning needs webbed. (check out pen in mobile view, , you'll see mean) this code, html here <div class="col-xs-12 col-sm-8 start">start ride </div> <div class="col-xs-12 col-sm-4 pull-right open">open ride</div> <div class="hidden-xs hidden-sm"></div> <div class="col-xs-12 col-sm-8 pull-left rides ">rides have</div> <div class="col-sm-4 hours">hours of operation</div> with css .start { height: 125px; background: #fcc; } .open { height: 95px; background: #fdb; } .hours { height: 50px; background: #ffb; } .rides { height: 150px; background: #cfc; } and pen illustration purposes http://codepen.io/kdweber89/pen/lvddkk?editors=110 the problem here that, top 2 divs change sizes. because of b...

javascript - Node handbrakejs runs the code but doesn't output -

so have following code: var hbjs = require('handbrake-js'); var encodingoptions = { input: media.file.path, output: media.targetdir+"helloworld.m4v", quality: 17, optimize: '', encoder: "x264" }; hbjs.spawn(encodingoptions) .on("begin",function(){ console.log('begin') }) .on("error", function(err){ // invalid user input, no video found etc console.log('error!') }) .on("progress", function(progress){ console.log( "percent complete: %s, eta: %s", progress.percentcomplete, progress.eta ); }) .on("complete", function (complete) { console.log('hello'); }) this code runs , once complete following console message: complete now here odd ...

php - Doctrine2 / PostgreSQL - Selection error with a nullable relation -

in zf2 application, have 2 doctrine2 entities : product , partner because in cases product doesn't need partner, there nullable manytoone relation between product , partner. it works if partner provided in form (dropdown). if not, have error : an exception occurred while executing 'select t0.id id1, t0.title title2 partners t0 t0.id = ?' params [""]: sqlstate[22p02]: invalid text representation: 7 error: invalid input syntax integer: ""` the entities : /** * @orm\entity * @orm\table(name="products") */ class product extends abstractentity { /* ... */ /** * @orm\manytoone(targetentity="partner", inversedby="products", cascade={"persist", "merge"}) * @orm\joincolumn(name="partner_id", referencedcolumnname="id", nullable=true) */ protected $partner; /* ... */ /** * @return partner */ public function getpartner() {...

c# - Is there a way to detect breaks in a TPL Dataflow graph -

i create complex tpl dataflow graphs, , happens there break in graph somewhere. symptom of app hangs, because of dataflow blocks waiting messages. is there way detect when happens, other manually tracing graph? can see there linkedtargets property available in debug view of dataflowblock - when have break set 0. since not public can't write automatically check this. you can use reflection. tpl dataflow debugger visualizer uses reflection retrieve linked targets in dataflowblockdebuginforetriever.getinnerdataflowdebuggerinfo , create list of nodes each block. creates graph structure using quickgraph . this structure can visualized visualizer does, or can search partitions in code. quickgraph implements several algorithms may of use. a simpler solution though, search non-actionblock blocks 0 linked targets

c# - How can i use a timer in synchronization with background worker? -

i using background worker in application data hardware , updating in ui continuously. need configure hardware info it. here requirement change configuration of hardware every 2 sec , need update corresponding info in ui. how can achieve proper synchronization? edit: here posting logic: worker3.workerreportsprogress = true; worker3.workersupportscancellation = true; worker3.dowork += new doworkeventhandler(worker3_dowork); worker3.progresschanged += new progresschangedeventhandler(worker3_processchanged); dispatchertimer timer = new dispatchertimer(); private void button_click_1(object sender, routedeventargs e) { timer.interval = timespan.fromseconds(5); timer.tick += timer_tick; timer.start(); worker3.runworkerasync(); } private void worker3_dowork(object sender, doworkeventargs e) { // here running infinite loop. in loop // calling function in dll data harware. pas...

Perl preprocessor appended to other variable -

i trying write following code, want $varpre1 $var1 , $varpre2 $var2 after preprocessor evaluated, not working. there work around? #define pre1 1 #define pre2 2 $var1 = 10; $var2 = 20; print $varpre1; print $varpre2; what wrote doesn't make sense c preprocessor, since varpre1 parsed 1 token. what want sort of possible, using called symbolic references, a bad idea . $pre1 = '1'; $pre2 = '2'; $var1 = 10; $var2 = 20; print ${'var' . $pre1}; # same print $var1 => 10 print ${'var' . $pre2}; this not work under use strict refs . bad idea not use strict refs .

ruby on rails - How to display error messages in a multi-model form with transaction? -

two models, organization , user, have 1:many relationship. have combined signup form organization plus user organization signed up. the problem i'm experiencing is: when submitting invalid information user, renders form again, should, error messages (such "username can't blank") user not displayed. form work when valid information submitted , display error messages organization, not user. how should adjust code below error messages user displayed? def new @organization = organization.new @user = @organization.users.build end def create @organization = organization.new(new_params.except(:users_attributes)) #validations require organization saved before user, since user requires organization_id. that's why users_attributs above excluded , why below it's managed in transaction rollbacks if either organization or user invalid. works desired. @organization.transaction if @organization.valid? @organization.save begin ...

iOS Hpple HTML parse -

so, need parse contents of website tableview in application. tried hpple , in testcases works. in specific case can't work... html: <!doctype html public "-//w3c//dtd xhtml 1.1//en" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="willi.css"> </link><script src="style.js" type="text/javascript"></script> <title>homepage</title> </head> <body> <a name="oben"/> <h1>date</h1> <br /> <a href="#07.07.2015">07.07.2015</a><br /> <a href="#07.08.2015">07.08.2015</a><br /> <a name="07.07.2015"> <hr /> </a> <p class="page" style="text-align:left"> ...

How do production Cassandra DBA's do table changes & additions? -

i interested in how cassandra production dba's processes change when using cassandra , performing many releases on year. during releases, columns in tables change , number of cassandra tables, new features , queries supported. in relational db, in production, create 'view' , boom data there - loaded view's query. with cassandra, dba have create new cassandra table , have write/run script copy required data table? can production level cassandra dba provide pointers on processes? we run small shop, can tell how manage table/keyspace changes, , may differ how others done. first, keep text .cql file in our (private) git repository has of our tables , keyspaces in current formats. when changes made, update file. lets other developers know current tables like, without having use ssh or devcenter . has added advantage of giving file allows restore our schema single command. if it's small change (like adding new column) i'll try out there prio...

php - MySQL second to formatted date time -

how convert second formatted date time in mysql? have query date difference in second. i.e select timestampdiff(second, '2012-06-03 13:13:55', '2012-06-06 15:20:18') sec now need convert seconds in date time in sql. possible? or there function in mysql datetime fields difference formatted option select datediff('%m %d, %y %h...', '2012-06-03 13:13:55', '2012-06-06 15:20:18') sec so expected result 1 mon 5 day 13 hour 3 sec this seems work select timestampdiff(second, '2012-06-03 13:13:55', '2012-06-06 15:20:18') secs, timestampdiff(minute, '2012-06-03 13:13:55', '2012-06-06 15:20:18') mins, timestampdiff(hour, '2012-06-03 13:13:55', '2012-06-06 15:20:18') hours, timestampdiff(day, '2012-06-03 13:13:55', '2012-06-06 15:20:18') days, timestampdiff(month, '2012-06-03 13:13:55', '2012-06-06 15:20:18') months, timestampdiff(year, '2012-06-...

ios - Is there any way to create hourly RecurrenceRule? -

i have ekevent occurs every 4 hours, , want create single recurring event. unfortunately available frequencies in ekrecurrencerule class daily, weekly, monthly, , yearly. how can set hourly frequency ekrecurrencerule object ? unfortunately there no way make hourly events using ekrecurrencerule objects, can still write method same. func createhourlyrecurringevent(eventtitle: string, startdate: nsdate, enddate: nsdate, endreccurencedate: nsdate, allday : bool, recurrencesecondsinterval: double, alarms: [ekalarm]? , traveltime: int?) { var eventstartdate = startdate var eventenddate = enddate while eventstartdate.earlierdate(endreccurencedate) != endreccurencedate { let event = ekevent(eventstore: self.eventstore) event.title = eventtitle event.startdate = eventstartdate event.enddate = eventenddate event.allday = allday event.alarms = alarms event.calendar = eventstore.defaultcalendarf...

node.js - Cannot read property '_host' of null when running supertest in node-inspector -

i'm new angular world , have been using angular-fullstack generator + yeoman build out project. i'm using sublime (not webstorm) , have been trying figure out how set project can debug mocha tests terminal, hitting wall. here's default things.spec.js that's generated 'yo angular-fullstack' debugger statement added in. var should = require('should'); var app = require('../../app'); var request = require('supertest'); describe('get /api/things', function() { it('should respond json array', function(done) { request(app) .get('/api/things') .expect(200) .expect('content-type', /json/) .end(function(err, res) { debugger; if (err) return done(err); res.body.should.be.instanceof(array); done(); }); }); }); by combining advice grunt-mocha-test documentation , so answer , i've upd...

c++ - cuda thrust based approach to grouping packets in tcp stream -

i have tcpdumps (.pcap) files of captured packets millions of packets. need group network packets tcp streams. example: let consider following packets no => source_ip, destination_ip,source_port,destination_port 1 => ip1, ip2, s1, s2 2 => ip1, ip3, s3, s4 3 => ip2,ip1, s2, s1 4 => ip3,ip1, s4,s3 now in above example of 4 packets, packets 1,3 , 2,4 packets of same stream. i.e need resolve following packets [[1,3],[2,4]]. my approach: since (ip1, ip2, s1, s2) , (ip2, ip1, s2, s1) indicates same stream decided hash both of them , name forward_hash , reverse hash denote packets of same stream flowing in opposite directions. i use index array keep track of packets during replacing , sorting. after final sorting, starting , ending of same hashes extracted , used against index array packet indices represent stream keys forward_hash of each packets, count number of packets, packet_ids id of each packet corresponding each of hash thrust::device_vect...