Posts

Showing posts from June, 2010

Docker, Vagrant, CentOS 7, cannot start -

the /var/log/messages log below aug 3 04:27:54 localhost lvm[3169]: thin centos-docker--pool 100% full. aug 3 04:27:54 localhost lvm[3169]: insufficient free space: 1 extents needed, 0 available aug 3 04:27:54 localhost lvm[3169]: failed extend thin centos-docker--pool. and systemctl status log below: docker.service - docker application container engine loaded: loaded (/usr/lib/systemd/system/docker.service; enabled) active: failed (result: exit-code) since mon 2015-08-03 04:22:52 utc; 6min ago docs: http://docs.docker.com process: 7577 execstart=/usr/bin/docker -d $options $docker_storage_options $docker_network_options $add_registry $block_registry $insecure_registry (code=exited, status=1/failure) main pid: 7577 (code=exited, status=1/failure) aug 03 04:22:52 localhost.localdomain systemd[1]: starting docker application container engine... aug 03 04:22:52 localhost.localdomain docker[7577]: time="2015-08-03t04:22:52z" level=info msg="+job...

highlight.js for Markdown uses one colour everywhere -

the official demo of markdown awesome. tried follow guide, result not match expectation, colour of words green. <!doctype html> <html> <head> <title>highlight.js example</title> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.7/styles/darkula.min.css"> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.7/highlight.min.js"></script> <script>hljs.inithighlightingonload();</script> </head> <body> <pre><code class="markdown"> # hello world can write text [with links](http://example.com) inline or [link references][1]. * 1 _thing_ has *em*phasis * 2 __things__ **bold** [1]: http://example.com --- hello world =========== > markdown cool code segments 1. 1 thing (yeah!) 2. 2 thing `i can write code`, , `more` wipee! ...

knockout.js - Bind a <select> to an array in knockoutjs? -

i have checkbox list on page bound knockout observablearray. when checkboxes selected knockout updates observablearray expected [123, 345, 456] (if 3 options in checkbox list selected) it fires off few functions goes through array , bunch of things. my trouble want able switch between using checkbox list , <select> . single select vs multiselect, using same ko.observable... these functions don't work when it's flat string , not array. when using <select> , there way can observable function single value array? e.g using select... <select data-bind="value: myobservable"> i want make selected value in myobservable be: ["123"] (or [123]) instead of plain string "123" you can use selectedoptions binding instead of value . <select data-bind="selectedoptions: myobservable"> if need multiple selection can use multiple="true" : jsfiddle

php - How can I make a select statement appear when another select statement is selected -

so "type1" select statement select issue category, , based on issue want dropdown of employees deal issue in drop down. how make hidden select statements occupy same space? here code: <!doctype html> <html> <head> <title>issuereport</title> <script src = "../../jquery.js"></script> <style> body{ padding:0; margin:0; } #box { padding: 5px; color:black; margin: 0 auto; border-style: solid; border-color: #0000e6; border-width: 2px; background-color: #58c6eb; width: 162px; height: 687px; float: left; border-radius: 10px; } .word{ color: #0000e6; } .buttons{ background-c...

ios - UIAlertController in swift -

i creating view controller in swift few text fields , accept button confirms user's input. accept button checks if of text fields empty. if so, pop alert saying it cannot empty . if not empty, store input , jump view. i created separated function called checempty() looks this: func checempty(title: string, object: uitextfield) -> (bool) { if object.text.isempty { let alertcontroller = uialertcontroller(title: "invalid input", message:"\(title) cannot empty", preferredstyle: uialertcontrollerstyle.alert) alertcontroller.addaction(uialertaction(title: "dismiss", style: uialertactionstyle.default) self.presentviewcontroller(alertcontroller, animated: true, completion: nil) return false } else { return true } } and call function in acceptbutton action: @ibaction func acceptbutton(sender: u...

.net - How do write LINQ query to do recursion? -

if had object called thing had property id , children children list of thing . this: public class thing public property id guid public property children list(of thing) end class now given existing list(of thing) , let's called alist sake of example, how use linq recursively loop throw each thing , children find out if item exist in entire hierarchy? dim alist list(of thing) in order words, given id, how write linq statement against alist see if id exists anywhere in hierarchy? hope can me , in advance contribution! linq isn't designed recursion , doesn't handle well. there ways shoehorn standard recursive function cleaner , easier debug: public function isintree(thing thething, ienumerable(of thing) tree) boolean if tree.any(function(t) t.id = thething.id) isintree = true elseif children not nothing isintree = tree.any(function(t) isintree(thething, t.children)) else isintree = false end if ...

PHP Date comparison issue -

i trying see if date between first , last of current month. have tried convert following $dateinfo string date, can compare values... how can accomplish this? dateinfo has in format below. variables: $dateinfo = '20150624t14:49:59' $dfirst = new datetime('first day of month'); $dlast = new datetime('last day of month'); the comparison: if(($dateinfo >= $dfirst) && ( $dateinfo<= $dlast )){ echo 'something';} } try using datetime object: <?php $dateinfo = new datetime('20150724t14:49:59'); $dfirst = new datetime('first day of month'); $dlast = new datetime('last day of month'); if (($dateinfo >= $dfirst) && ($dateinfo <= $dlast)) { $string = "%s between %s , %s"; printf($string, $dateinfo->format('d/m/y'), $dfirst->format('d/m/y'), $dlast->format('d/m/y')); }

javascript - XMLHttpRequest.getResponseHeader() returns null -

i've created custom mime type called application/x-mytype extension .mytype following this link . then, created file in server named test.mytype , i'm trying it's content-type via xmlhttprequest looks browser cannot detect it. var xmlhttp; if (window.xmlhttprequest) {// code ie7+, firefox, chrome, opera, safari xmlhttp = new xmlhttprequest(); } else { xmlhttp = new activexobject("microsoft.xmlhttp"); } xmlhttp.open("get", "https://{myserver}/test.mytype", true); xmlhttp.send(null); xmlhttp.onreadystatechange = function (oevent) { if(xmlhttp.readystate==4) { var contenttype = xmlhttp.getresponseheader('content-type'); console.log(contenttype); // prints null if(contenttype === 'application/x-mytype') { // never arrives here } } }; if @ "file type" via windows explorer, can see custom type, looking @ windows registries. have set else or browser...

asp.net mvc - NHibernte CreateAlias for 2 multiply class -

i have 3 classes: book, genre, authors public class book { public virtual int id { get; set; } public virtual string name { get; set; } public virtual string description { get; set; } public virtual int mfraiting { get; set; } public virtual int pagenumber { get; set; } public virtual ilist<genre> genres { get; set; } public virtual series series { get; set; } public virtual mind mind { get; set; } public virtual ilist<author> authors { get; set; } public book() { genres = new list<genre>(); authors = new list<author>(); } } public class genre { public virtual int id { get; set; } public virtual string name { get; set; } public virtual ilist<book> books { get; set; } public genre() { books=new list<book>(); } } public class author { public virtual int id { get; set; } public virtual string name { get; set; } public virtual string sur...

vba - Copy last two columns and insert to the left of them -

i having trouble being able copy last 2 columns data in worksheet , insert same columns left of them. here code far, copies correct columns pastes them right. sub globalperformnewmonths() dim lnglastrow long thisworkbook.worksheets("global supplier performance") lnglastrow = .range("a" & .rows.count).end(xlup).row .cells(1, .columns.count).end(xltoleft).offset(,resize(lnglastrow,copy .cells(1, .columns.count).end(xltoleft).offset(, -2) columns("d:az").columnwidth = 18.43 application.cutcopymode = false end end sub try selecting entire columns of data want. select them , insert them left of desired column. range("d:e").select selection.copy columns("c:c").select selection.insert shift:=xltoright

powershell - How to get the value of the PATH environment variable without expanding tokens? -

i'm writing powershell script convert folder names short names in path environment variable , save changes. works correctly explicit paths, expands tokens, when save changes tokens replaced explicit paths. i'd preserve tokens. for example, if path this: %systemroot%;%systemroot%\system32;c:\program files\tortoisesvn\bin;c:\programdata\chocolatey\bin i want result: %systemroot%;%systemroot%\system32;c:\progra~1\tortoi~1\bin;c:\progra~3\chocol~1\bin but instead this: c:\windows;c:\windows\system32;c:\progra~1\tortoi~1\bin;c:\progra~3\chocol~1\bin here's full script illustrates problem. # current path. # ended not using either of these approaches because appear # contextual; on system, @ least, include paths aren't # seen when view path value system properties -> environment # variables dialog box. $current_path = $env:path $current_path = [system.environment]::getenvironmentvariable("path") # instead, path value directly registry, so: $curren...

C++ manually Convert string to int? -

i trying manually convert string int, , have had difficulties. first check see if string entered integer. next, want convert string integer without using library methods. when ran code inside loop line line, did needed to, when ran inside loop, spat out incorrect binary results. ==> going check if value enter number. ==> enter number: 234 ==> input result: 1 ==> press enter continue... ==> 11001 // darian nwankwo, random programs, august 2, 2015 #include <iostream> #include <string> #include <cmath> int main(int argc, const char * argv[]) { std::string number = ""; bool isnumber = false; std::cout << "i going check if value enter number." << std::endl; std::cout << "enter number: "; std::cin >> number; std::cin.ignore(); // iterate through variable number check if number ( int = 0 ; < number.length() ; i++ ) { if ( number[i] < 48 || ...

php - WAMP server stopped working due to Fatal error: Call to undefined function oci_connect() -

so far using wamp server oracle past 1 year,but unfortunately stopped working , displaying error fatal error: call undefined function oci_connect() . verified dll files , connection dint modification past 1 year , verified related link fatal error: call undefined function oci_connect() .how can fix error.kind give solution. i have refer , verified lots of reference links. perfect. past 1 year working perfectly, today morning not work , shown above error here, how can solve this? may dll crashed. can update required dlls? otherwise reinstall oracle? it work..

Creating a Web Service client with Java -

working on xpages project, want create web service client in java accesses api of newsletter services (www.cleverreach.de). url wsdl have. here . how go creating client? strategy? i following error: "jvm: java.rmi.remoteexception: no operation description found service {crs}interface v5" after running below code: apikey ="1a045d62d0dd2246c32dsdf40277b861gfd6d4"; string client =""; interfacev5locator crs = new interfacev5locator(); interfacev5porttype port= crs.getinterfacev5port() client = port.clientgetdetails(apikey).tostring(); return client; your question not clear, kind of framework using connect web service , generate client? suggest use jaxws , follow instructions on link bellow. http://docs.oracle.com/cd/e17802_01/webservices/webservices/docs/2.0/tutorial/doc/jaxws3.html

Change csv delimiter with java -

the code works fine when use at_separator=",". reason, want change at_separator="@@@" instead of ",". when add data csv file, inserts data new cell when finds "@@@". don't know how change format of csv file default delimiter changes "," "@@@". change or add change csv default delimiter? method in different class writing csvfile. here, at_separator="@@@"; csvfilewriter csvfilemethod = new csvfilewriter(); csvfilemethod.createcsv(filename); while(rs.next()) { csvfilemethod.saveit(starttime, rs.getstring("owner") + at_separator + rs.getstring("name") + at_separator + rs.getstring("type") + at_separator + rs.getint("line") + at_separator + rs.getstring("text") + at_separator + parentsystem_id + at_separator+ parentplatform); } csvfilemethod.closecsv(); and csv writer...

php - Building dynamic queries which contains between clause -

i need generate dynamic queries in program based on search criteria. commonly using following method. need add between clause this. $firstname = 'aaa'; $lastname = 'bbb'; $fromdate = '2015-01-01'; $todate = '2015-01-31'; $query = 'select * users'; $cond = array(); $params = array(); if (!empty($firstname)) { $cond[] = "firstname = ?"; $params[] = $firstname; } if (!empty($lastname)) { $cond[] = "lastname = ?"; $params[] = $lastname; } if (!empty($fromdate) && !empty($todate)) { // here need add between $fromdate , $todate } if (count($cond)) { $query .= ' ' . implode(' , ', $cond); } $stmt = $pdo->prepare($sql); $stmt->execute($params); is there way add between clause code? just add clause before executing. if (count($cond)) { $query .= ' ' . implode(' , ', $cond); } if (!empty($fromdate) && !empty($todate)) { $query .= ...

c# - How to add an empty row to a datatable based on value from column -

i working c# 4.5 on winform. have dataset filled data sql proc uses group grouping sets has row aggregate contains value "totals" in second column. want insert empty row after each row has "totals" in column. data exported excel , want empty row between groups legibility. thanks. for (int = 0; < datatable.rows.count; i++) if (datatable.rows[i][0] == "totals") datatable.rows.insertat(datatable.newrow(), ++i);

ios8 - Paypal integration for ios -

we building iphone application includes paypal integration. our application simple buyer-seller iphone application. need make sinlge payment(buyer seller) using paypal ios sdk. have gone through documentation. when login screen sdk launched, need log in buyers's creadentials. however, have not understood or rather confused if "merchantname" suppose mention seller's paypal credential(email). please me if integrated paypal in ios application. thanks in advance. "merchant name" name of application provided https://developer.paypal.com/developer/applications when set application. note peer-to-peer operations not supported sdk.

javascript - Web Audio API - strange 5.1 behavior -

i'm trying play video file using js web audio api. here link: sample code when click play icon, channels playing correctly. when click "play" button, have audio left , right channels. how can fix this? browser chrome. the web audio api defaults 2 channels. should able increase number of channels setting audioctx.destination.channelcount higher number.

javascript - Electron (Atom Shell) severely crashes Windows -

Image
i writing application , running electron. testing , debugging things, start application (electron.exe) , close every (sometimes maybe once or twice per minute). after (seemingly random , not related code change) while, following errors appear right when starting application: at point, application flashes 1 time when open runs normally. usually not long after, starting application results in errors below: at point, application frozen few seconds when opening , runs apparently slower usual. starts happen, impossible open browser page (tested chrome , ie) - page remains blank , process seems hang: the worst @ point, windows not shut down properly. trying sign out or shutdown results in blue screen cursor stuck "loading" icon forever. solution there force computer shut down holding power button. when doing this, had 50% chance of having windows stuck in infinite repair loop, no other choice system restore. so learned must reboot windows gl_invalid_operation ...

sql server - How do I modify my SQL Query to take into account this specific filtering condition? -

i using sql query 2014 , have following t-sql query running against database: use database select * ( select a.reservationstayid, c.pmsconfirmationnumber, a.staydate, datepart(month,a.staydate) 'month', datepart(year,a.staydate) 'year', c.[mth], a.packageplancode, c.[market segment code], c.[currencycode], a.rateamount, sum(a.rateamount) over(partition a.reservationstayid) 'cum_rate', d.[exchange rate], ((a.rateamount * d.[exchange rate])/1.15) 'pr', c.[propertycode], c.[room nights], c.[tour operator], c.[group booking id], c.[source of business], c.[booking origin (1)], c.[market final], c.[createdon], c.[createdon_rsd] reservationstaydate inner join (select * [reservationlist]) c on c.[reservationstayid] = a.reservationstayid , c.[mth] = datename(m,staydate) + ' ' + cast(datepart(yyyy...

xcode6 - 'override' can only be specified on class members -

i'm getting error message in relation 'override func'. seems saying 'viewwillappear' not class member. can tell me how fix this? import uikit import avfoundation import coredata class soundlistviewcontroller: uiviewcontroller, uitableviewdatasource, uitableviewdelegate { @iboutlet weak var tableview: uitableview! var audioplayer = avaudioplayer() var sounds: [sound] = [] override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. self.tableview.datasource = self self.tableview.delegate = self override func viewwillappear(animated: bool) { // 'override' can specified on class members self.tableview.reloaddata() } }

vb.net - Remove first 27 characters from each line in richtextbox -

how go removing first 27 characters each line in richtextbox? i have tried for each in richtextbox1.lines = richtextbox1.text.remove(0, 27) next if want preserve formatting in richtextbox, way: private sub button1_click(sender object, e eventargs) handles button1.click integer = 0 richtextbox1.lines.length - 1 dim index integer = richtextbox1.getfirstcharindexfromline(i) richtextbox1.select(index, math.min(27, richtextbox1.lines(i).length)) richtextbox1.selectedtext = "" next end sub

ios - iAd Interstitials not showing consistently? And not at all on the simulator -

iad interstitials aren't showing @ on iphone simulator, , don't show consistently on iphone. i've gone developer settings, changed fill rate 100%, , turned on unlimited ad presentation. no difference... interstitial show first time it's supposed to, , won't show again anywhere few minutes fifteen minutes. no idea causing difference in time. also, there doesn't seem way track if interstitial going show or not / if showed or didn't. realize there's interstitial delegate, seems isn't used anymore. way calling interstitial using viewcontroller.interstitialpresentationpolicy = adinterstitialpresentationpolicy.automatic thanks! so seems using requestinterstitialadpresentation intended used when adinterstitialpresentationpolicy set automatic . when implementing interstitials using manual adinterstitialpresentationpolicy must use presentinview present ad @ own intervals. when presenting interstitial in manner not load own close button d...

websphere - Hung theads | java.io.FileInputStream.open(Native Method) | NFS server -

we have 4 lpars running 1 java instance each. they lot of read/write operations shared nfs server. when nfs server goes down abruptly, threads trying read image in each of these 4 servers gets hung state. below trace shows same (process websphere applciation server process) while working on issues in nfs server side, there way avoid code side? if underlying connection tcp based (which assume is), should tcp read/connect timeout take care of this? want thread returned pool instead of waiting infinitely other side repond. or should taken care nfs 'client' on source machine? config setting on client side pertaining nfs (since fileinputstream.open not know whether file trying read on local server or shared folder in nfs server) thanks in advance answers :) we using java 1.6 on 7.0 [8/2/15 19:52:41:219 gst] 00000023 threadmonitor w wsvr0605w: thread "webcontainer : 77" (00003c2b) has been active 763879 milliseconds , may hung. there is/are 1...

vb.net - Background Workers and Successive Events -

i'm again, more code last time. may reference previous questions here , there question independent i managed convince employer drop proprietary serial port communications library made use, starting scratch serialports , backgroundworkers know how work. here code: imports system imports system.io.ports public class form1 'serialport port , backgroundworker worker declared in form delegate sub appendtext_delegate(byval txtbox textbox, byval str string) private sub form1_load(sender system.object, e system.eventargs) handles mybase.load port.portname = ("com9") port.baudrate = 115200 port.parity = parity.none port.stopbits = stopbits.one port.handshake = handshake.none port.readtimeout = 1000 port.writetimeout = 1000 port.open() addhandler port.datareceived, addressof datareceived worker.workerreportsprogress = true worker.workersupportscancellation = tru...

Missing become password in ansible playbook -

i trying create playbook deploy simple scenario: login server , clone/update open github repo. access parameters written in ~/.ssh/config here files: hosts [staging] staging deploy.yml - hosts: staging tasks: - name: update code git: repo=https://github.com/travis-ci-examples/php.git dest=hello_ansible when trying run ansible-playbook -s deploy.yml -i hosts , outputs error this: gathering facts *************************************************************** fatal: [staging] => missing become password task: [update code] *********************************************************** fatal: no hosts matched or hosts have failed -- aborting i have tried add sudo: false , become: false , not seem have effect. assume operation should not request sudo password trying work files in ssh user's home directory. i sorry if question bit lame, not have experience ansible. it asking sudo password because using -s option. seems not want use...

OpenErp(Odoo) How to add custom analysis on reporting Tab -

i need make summery of raw materials used, qualty of products ,final products status . . . for each manufactureing process , provide information on reporing tab sales anlysis , purchase analysis . . . how can this? , insights requirment? create module custom analysis report. explain how sales analysis report created. using create own analysis report. steps create module report in addons folder. can use following link details creating module how create odoo module create python file in module , import in __init__.py file. in file create model based on postgresql view . add method init(self, cr) creates postgresql view matching fields declared in _columns . can check in file sale_report.py in report folder of sale module. create fields needed in _columns , write query in init method getting values these fields. specify parameter _auto=false openerp object, no table corresponding _columns dictionary created automatically. for model sale.report data ta...

ios - How to properly use generics on obj-c? -

with new xcode7 apple introduced generics , nullability objective-c ( developer guide ) but seems different have on swift. nullability: - (nonnull nsstring *)something { return nil; } this should raise warning! , can assign return value of method nonnull variable like: //@property (copy, nonnull) nsstring *name obj.name = [obj something]; generics: looking example: @property (nonatomic, strong, nonnull) nsmutablearray <uiview *> *someviews; a warning raised when different uiview inserted on array [self.someviews addobject:@"foobar"]; //<- raises error but not in case: self.someviews = [@[@"foobar"] mutablecopy]; nor in case: nsstring *str = [self.someviews firstobject]; so question is, i'm using generics , nullability in wrong way or far away swift implementation? self.someviews = [@[@"foobar"] mutablecopy]; mutablecopy inherited nsobject , declared return id . not declared nsarray , nsarra...

ASP.NET MVC date string slash being converted to dash in Safari input fields -

Image
i outputting datetime string format of mm/dd/yyyy text input field. works fine on browsers except latest version of safari (on yosemite, if matters). see examples below: this code: <div><input type="text" value='@model.arrival.value.tostring("mm/dd/yyyy")' /></div> <div><input type="text" value="@html.raw(model.arrivaldatestring)" /></div> <div><input type="text" value="8/23/2015" /></div> <div><input type="text" value="08/23/2015" /></div> produces this: the test page setup has absolutely nothing else running on it. it's bare bones html page server side output view model. mvc 5 , .net framework 4.5.1 viewing page source, looks in safari: <input type="text" value="08-20-2015" /> on other browsers, this: <input type="text" value="08/20/2015" /...

how to pass whole data using ajax in php using keypress event -

i passing empcode using key press event, whole empcode not transfered , last digit cut. here code: $(document).ready(function(){ $("#e_code").keypress(function(){ //var datastring=document.getelementbyid("e_code").value; var datastring = 'e_code='+ $(this).val(); $.ajax({ type: "post", url: "getdata.php", data: datastring, cache: false, success: function (html) { $('#details').html(html); $('#custtrnhistory').show() } }); }); }); on getdata file code write code in keyup instead of keypress $("#e_code").keyup(function(){

java - Spliterator state after "consumed" in Stream -

i think i've run issue assumption made: if spliterator's item isn't consumed stream, spliterator still able advance it. seems not case. here's code demonstrate: import java.util.spliterator; import java.util.function.function; import java.util.stream.collectors; import java.util.stream.stream; import java.util.stream.streamsupport; /** * created dsmith on 7/21/15. */ public class spliteratortest { public static void main(string[] args) { system.out.println("test 1"); test1(); system.out.println("test 2"); test2(); } public static void test1() { final spliterator<string> spliterator1 = stream.of("a", "b", "c", "d", "e", "f").spliterator(); streamsupport.stream(spliterator1, false). limit(3). collect(collectors.tolist()); system.out.println("spliterator1.estimatesize() ...

php - Update multiple select box -

i have code : <?php if($_get["id"]){ $rezizmjena = mysqli_query($kon, "select * shops id=". $_get["id"] ." limit 1"); $redizmjena = mysqli_fetch_assoc($rezizmjena); $fototxt = "nieuwe logo :"; $btntxt = "veranderen"; }else{ $fototxt = "kies logo :"; $btntxt = "toevoegen"; } ?> <div class="col-xs-12 col-sm-5"> <select class="form-control" name="slcregio[]" multiple="multiple"> <?php $rez = mysqli_query($kon, "select * regios"); echo "<option selected disabled>kies een regio</option>"; while($red = mysqli_fetch_assoc($rez)){ $rez1 = mysqli_query($kon, "select regios.id, shop_regio_tt.regio_id, shop_regio_tt.shop_id regios inner join shop_regio_tt on regios.id = shop_regio_tt.regio_id...

c# - TFS 2013 won't build a .NET Framework 4.6 project -

i trying tfs2013 build .net framework 4.6 c# project on our build servers. have installed build tools , 4.6 .net framework out on build machine. can see build log build server targeting 4.6 .net framework. earlier had issues getting dll references cleaned me installing 4.6 framework. tried installing visual studio 2015 on build server , still won't build. i have tried passing /p:visualstudioversion=14.0 parameter. kind of running out of ideas or things try build working. i figured out needed do. to let tfs2013 run builds 4.6 need following: install 4.6 framework , build tools 2015. or install visual studio 2015 (which installs framework , build tools). then can either modify build template , hard code build tools template. or path choose use argument: /tv:14.0

javascript - Listening directly to Reflux Actions in Component -

from i've read pattern components pass data actions pass store value changes trigger updates in components subscribe stores. question how "react" these triggered updates in form of notification? ( ie saved notification ) ie add logic render of notification component displays if there flag attribute in object subscribed to? deletes after time. sounds wrong. update thanks hannes johansson think have better grasp of pattern. have working following: component passes data through action store the store interacts api , adds flag model component notified of updated model. createitem: function (item) { $.ajax({ url: '/items', method: 'post', data: item, success: function (item) { currentbrandactions.addcampaign(item); this.item = item; item.newlycreated = true; this.trigger(item); }.bind(this) }) } the component sees flag , renders "notificati...

meteor - How to get phones from users collection -

i need phone numbers textarea users collection.how can do? smsnumaralar=textarea template.uyeleresmsgonder.events({ 'click #numaralarikopyala': function (e, template) { var getdata=meteor.users.find({}); template.$('#smsnumaralar').val(getdata.profile.phone); } }); you can extract array of phone numbers using map , join given separating character (a newline in example), , put newly created string of phone numbers in textarea: template.uyeleresmsgonder.events({ 'click #numaralarikopyala': function (e, template) { var phonenumbers=meteor.users.find({}).map(function (user) { return user.profile.phone; }).join('\n'); template.$('#smsnumaralar').val(phonenumbers); } });

How is the data used for speech recognition collected and prepared? -

as far can tell, speech recognition implementations rely on binary files contain acoustic models of language trying 'recognize'. so how people compile these models? one transcribe lots of speeches manually, takes lot of time. even then , when given audio file containing speech , full transcription of in text file, individual word pronunciations still need somehow separated. match parts of audio correspond text 1 still needs speech recognition. how gathered? if 1 handed on thousands of hours' worth of audio files , full transcriptions (disregarding problem of having transcribe manually), how can audio split @ right intervals 1 word ends , begins? wouldn't software producing these acoustic models already have capable of speech recognition? so how people compile these models? you can learn process going through c musphinx acoustic model training tutorial one transcribe lots of speeches manually, takes lot of time. this correct, model prepa...

android - Cannot check out from svn -

Image
when try check out svn , showing alert . i using svn link , working on past couple of months. needed same copy of project svn in new window other work. but, when try checkout, shows alert. could help? i solved check out svn project eclipse , import project local directory android studio. after committed new copy in separate svn location. based on comment of @rambabu pudari assume, check out project svn client tortoisesvn or sliksvn on windows. then able import androidstudio. workaround fix problem? it useful know, if can manage svn commits android studio after importing it.

c - Floating point conversion - Binary -> decimal -

here's number i'm working on 1 01110 001 = ____ 1 sign bit, 5 exp bits, 3 fraction bits bias = 15 here's current process, can tell me i'm missing something convert binary exponent decimal 01110 = 14 subtract bias 14 - 15 = -1 multiply fraction bits result 0.001 * 2^-1 = 0.0001 convert decimal .0001 = 1/16 the sign bit 1 result -1/16, given answer -9/16. mind explaining 8 in fraction coming from? you seem have correct concept, including understanding of excess-n representation, you're missing crucial point. the 3 bits used encode fractional part of magnitude 001 , there implicit 1. preceding fraction bits, full magnitude 1.001 , can represented improper fraction 1+1/8 => 9/8 . 2^(-1) same 1/(2^1) , or 1/2 . 9/8 * 1/2 = 9/16 . take sign bit account, , arrive @ answer -9/16 .

python - ValueError with Pandas - shaped of passed values -

i'm trying use pandas , pyodbc pull sql server view , dump contents excel file. however, i'm getting error when dumping data frame (i can print colums , dataframe content): valueerror: shape of passed values (1, 228), indices imply (2, 228) there several other issues on forum pertaining same issue, none discuss pulling sql server table. i can't figure out causing error, , altering view cast source columns differently has no effect. here python code i'm using: import pyodbc import pandas pd cnxn = pyodbc.connect('driver={sql server};server=servername;database=dbname;uid=username;pwd=password') cursor = cnxn.cursor() script = """ select * schema.activeenrollmentcount """ cursor.execute(script) columns = [desc[0] desc in cursor.description] data = cursor.fetchall() df = pd.dataframe(list(data), columns=columns) writer = pd.excelwriter('c:\temp\activeenrollment.xlsx') df.to_excel(writer, sheet_name='bar...

html - Multi boxs css hover -

i want make box pack includes 5 below. when leaving mouse on box, box extend whole main div , display of rest of boxes set none. in code, box1's mouse hover extend. these codes. .multibox{ width: 300px; height: 300px; border: 1px solid black; overflow: hidden; } .multibox div{ position: absolute; transition: width 0.5s, height 0.5s, -webkit-transform 0.5s; -moz-transition: width 0.5s, height 0.5s, -webkit-transform 0.5s; /* firefox 4 */ -webkit-transition: width 0.5s, height 0.5s, -webkit-transform 0.5s; /* safari , chrome */ -o-transition: width 0.5s, height 0.5s, -webkit-transform 0.5s; /* opera */ -ms-transition: width 0.5s, height 0.5s, -webkit-transform 0.5s; /* ie9 (maybe) */ } .box1{ background: gray; width: 250px; height: 50px; float: right; display: block; position: initial !important; } .box1:hover{ width: 300px; height: 300px; } .box2{ background: blue; width: 50px; height: 250px; ...

MSER circles center -

i`m using mser feature detector detect circles image , works perfect have center of circles. know posibility center? here source code: void main() { mat inimg = imread(cprofilessuro1012desktop1.bmp); mat textimg; cvtcolor(inimg, textimg, cv_bgr2gray); vector vector point contours; vector rect bboxes; ptr mser mser = msercreate(22, (int)(0.00001textimg.colstextimg.rows), (int)(0.00015textimg.colstextimg.rows), 1, 1); mser-detectregions(textimg, contours, bboxes); for(int i=0;i1;i++) { for(int j=0;jcontours[i].size();j++) cout x=contours[i][j].x y=contours[i][j].y endl; coutendl; } (int = 0; bboxes.size(); i++) { cout x=bboxes[i].x y=bboxes[i].y endl; rectangle(inimg, bboxes[i], cv_rgb(0, 255, 0)); } cout contours[0].size()endl; imshow(, inimg); waitkey(0); } what did: float sumx = 0, sumy = 0; int size = contours.size(); point2f centroid; if(size > 0){ for(int i=0;i<size;i++) { for(int j=0;j<contours[i...

mongodb - Mongo aggregation within intervals of time -

i have log data stored in mongo collection includes basic information request_id , time added collection, example: { "_id" : objectid("55ae6ea558a5d3fe018b4568"), "request_id" : "030ac9f1-aa13-41d1-9ced-2966b9a6g5c3", "time" : isodate("2015-07-21t16:00:00.00z") } i wondering if use aggregation framework aggregate statistical data. counts of objects created within each interval of n minutes last x hours. so output need 10 minutes intervals last 1 hour should following: { "_id" : 0, "time" : isodate("2015-07-21t15:00:00.00z"), "count" : 67 } { "_id" : 0, "time" : isodate("2015-07-21t15:10:00.00z"), "count" : 113 } { "_id" : 0, "time" : isodate("2015-07-21t15:20:00.00z"), "count" : 40 } { "_id" : 0, "time" : isodate("2015-07-21t15:30:00.00z"), "count...

ios - Getting custom class property from contact.bodyA.node -

i developing ios game , having issue didbegincontact(). i trying .difference property 1 of custom classes, "fullbarclass". here code: func didbegincontact(contact: skphysicscontact) { var a: skphysicsbody var b: skphysicsbody if contact.bodya.categorybitmask < contact.bodyb.categorybitmask{ = contact.bodya b = contact.bodyb } else { b = contact.bodya = contact.bodyb } let bar : fullbarclass = contact.bodya.node let dif = int(bar.difference) println(dif) } on "let bar : ..." line, getting error: "sknode? not convertible 'fullbarclass' ". does know why not working? since contact.bodya.node optional and may not fullbarclass , can't assign body node object fullbarclass constant. can conditionally assign object bar if it's appropriate type by if let bar = contact.bodya.node as? fullbarclass { // execute if body node fullbarclass let dif = int(b...

django - Python selenium test gets stuck in urlopen -

my app relies on: python 3 django 1.8 weasyprint selenium it runs flawlessly on dev , production environment, not while testing selenium. using weasyprint, create pdf html, library uses urllib download css (e.g. http://localhost:8081/static/lib/bootstrap/css/bootstrap.min.css ), hangs (no errors, stuck) while opening these. if enter url directly in browser while hanged, css displayed. command used: ./manage.py test tests.test_account.homenewvisitortest relevant part of test: from selenium import webdriver class homenewvisitortest(staticliveservertestcase): def setup(self): if test_env_firefox: self.driver = webdriver.firefox() else: self.driver = webdriver.phantomjs() self.driver.set_window_size(1440, 900) def teardown(self): try: path = 'worksites/' + self.worksite_name.lower() os.rmdir(settings.media_root + path) except filenotfounderror: pass...