Posts

Showing posts from July, 2011

ios - .xcdatamodeld file not showing data model structure in Xcode -

i have .xcdatamodeld file in project not opening data model. when click on file in left sidebar in xcode, continues display contents of selected file instead of displaying data model. likewise, when right click on file , choose "open >", cannot select display data model—nothing comes up. checked out code svn repo , filer owner not able see in workspace. this symptom have seen time time. in @ least 1 case, due xcode having wrong path stored in path component of xcversiongroup section of project.pbxproj file, , having apparently unnecessary additional name component in section. possible manually edit file, i'm reluctant monkey around project file directly, , fortunately there's easier way. navigate .xcdatamodeld file in finder. easiest way right click/ctrl-click on .xcdatamodeld file , select "show in finder". drag file finder , drop above or below current reference .xcdatamodeld in project navigator in xcode project. click ok accept

How access the HTTP Headers in Windows Phone using WinJS.xhr? -

i'm trying access http headers after using winjs.xhr. i can headers using .getallresponseheaders function. receive few headers: date: fri, 15 jan 2016 20:35:44 gmt server: apache-coyote/1.1 x-backside-transport: ok ok content-type: application/json x-global-transaction-id: 4132445 transfer-encoding: chunked how can headers? this answer answered here: get http-only cookie windows 8 js app needed several headers that: the system handles cookies automatically

Sitecore ECM on CD is unable to find a campaign by ID (different core databases) -

i getting following exception when clicking on ecm email link points content delivery server, campaign id {} has not been found. source: sitecore.emailcampaign @ sitecore.modules.emailcampaign.core.emailresponse.handleemaillinkclickresponse(string link, guid campaignid, guid automationstateid) it works if change url cd host cm host. sitecore 7.1 e-mail campaign manager 2.1 rev. 140214 cm , cd configured use different core databases. is there anyway ecm working in configuration? needed publish 2 folders children, /sitecore/system/marketing center/campaigns /sitecore/content/home/email campaign manager/messages/

c# - Count depth of a hierarchy of classes -

i've seen lot of different examples of how , aware write out loop iterates entire tree of classes find maximum depth, cannot think there has simpler way. basically have 2 classes developed host applications settings, settinggroup sounds like, folder, , setting setting , configurations allow application know setting , how display it. reason dont use fixed class , write out field settings application plugin driven , wish settings remain centralized plugins added or removed , not have worry decentralized data plugins. when dynamically creating settings page necessary know maximum depth of particular settinggroup know if root should first organized tabs, pages, sections etc... long story short, there reasonably lightweight way determine groups maximum depth? public enum descriptionvisibility { none, subtext, tooltip }; public enum settingtype { bool, integer, decimal, text }; public enum settingcontrol { checkbox, textbox, slider, radio, dropdown, textfield, color}; pub

php - How to properly count json contents? -

this json [ {"id":"1736375","first_name":"fname1","force_first_name":"ffname1","last_name":"lname1","thumb_path":"","path":"img\/profiles\/generic\/gray.png"}, {"id":"1607011","first_name":"fname2","force_first_name":"ffname2","last_name":"lname2","thumb_path":"","path":"img\/profiles\/generic\/gray.png"}, {"id":"1607012","first_name":"fname3","force_first_name":"ffname3","last_name":"lname3","thumb_path":"","path":"img\/profiles\/generic\/gray.png"} ] i trying count number of sets inside [ ] i tried using this echo count(json_decode($people, true)); i 0 (0) result. how can count it. thanks === edit s

xelement - How to retrieve values by index from a dynamic Object -

string zohoresponse = @" [ { 'title':'mr.', 'first name':'ram', 'last name':'chang', 'employed @ trade client name':'mile travel', 'telephone':'657498333', 'e-mail':'abc@traveller.com', 'fax':' ', 'street':'123 street', 'city':'winnipeg', 'state / province':'manitoba', 'country':'canada', 'postcode':'r4t 600', 'agent id':70, 'primary sales agent':' ', 'employed @ from':'09/12/2008', 'employed @ to':'09/12/2028' } ] "; dynamic jsonobj = jsonconvert.deserializeobject(zohoresponse); xmldata = new xdocument( `ent

Kotlin Factory on Inner Nested Class -

i trying create nested inner class in kotlin companion object factory method (the equivalent of static factory method in java). here's simplified version of code. class outerclass { var mydata:list<mydata> = list<>() //gets populated elsewhere fun getitemfragment(position:int) : fragment() { return innerclass.factory.newinstance(position) } inner class innerclass : fragment() { companion object factory { fun newinstance(position:int) : innerclass { var ic : innerclass = innerclass() var bundle:bundle = bundle() bundle.putint("index", position) ic.arguments = bundle return ic } } override fun oncreateview(inflater:layoutinflater, container: viewgroup, savedinstancestate:bundle): view? { //create , return view, omitted. need access mydata } } the compilier highlights "companion

field - Drupal v7 - Weight and Balance Calculator -

fairly new drupal v7 , new js - i know possible do, not know start. i want create webform/input community able calculate weight , balance small engine planes-aviation requirements. example - not drupal - http://home.roadrunner.com/~trumpetb/alph/ i @ total lost upon start. far i've got computed field webform calculator , other supporting modules installed. anybody out there have experience or tutorials point me to? thanks!

Audio-video stream with use Liquidsoap -

i have problem audio-video stream icecast2 server using liquidsoap. using example code use picture in jpg format - works! <code>s = single("/mnt/dysk1/all/test.gif") output.icecast( %ogg(%theora), host="localhost", port=8000, password="*****", mount="/test1.ogg", name="test1", description="testing...", url=" ", s)</code> example code example use audio-video in avi format , audio-video in mp4 format , audio-video in webm format- did not work! <code>s = single("/mnt/dysk1/all/test.avi") output.icecast( %ogg(%theora, %vorbis), host="localhost", port=8000, password="*****", mount="/test1.ogg", name="test1", description="testing...", url=" ", s)</code> you receive following error message: invalid value @ line 1, char 12-36: not valid media file of kind {audio=2;video=1;midi=0} &

Java - Closing socket when reloading class -

so i'm working on server irc, , added config screen can edit port using, have reintialize listen class take effect, have in config class: listen.closeports(); new listen(); and here listen class: package server.network; import java.io.bufferedreader; import java.io.ioexception; import java.io.inputstream; import java.io.inputstreamreader; import java.net.serversocket; import java.net.socket; import server.server; import server.gui.guimain; public class listen { private static socket socket = null; private int port; public listen() { try { port = server.listenport; @suppresswarnings("resource") serversocket serversocket = new serversocket(port); guimain.jta.append("\nserver started , listening messages on port " + port + ".\n"); while(true) { socket = serversocket.accept(); inputstream = socket.getinputstream();

javascript - document.location modifies WebApi route when trying to download file -

i have application built angularjs , webapi. i'm trying download file when button pressed. code ng-click: $scope.download = function (documentobj) { if (documentobj && documentobj.filename) { var urlparams = "sid=" + documentobj.idstudy + "&fid=" + documentobj.idrequiredfile + "&fname=" + documentobj.filename; document.location = "api/document/download?" + urlparams; } }; this working in chrome , mozilla not in ie. in ie. have noticed url webapi different in ie after running code. more specifically: the view i'm working in has url: http://localhost:54094/admin/studies/edit/1 after call ng-click function should start download see following results: chrome: http://localhost:54094/api/document/download?sid=71&fid=4&fname=basis%20kht%202016.sql ie: http://localhost:54094/admin/studies/edi

Issues settings up subdomains w/ nginx -

i trying setup subdomain website phpmyadmin having issues trying work. when visit website working intended, when visit subdomain have setup shows me regular website , nothing related phpmyadmin. have been trying several different combinations try , working can't figure out. first time of me trying use nginx need help. here following configuration files. /etc/nginx/nginx.conf user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopu

sql - Exclude matched array elements -

how can exclude matched elements of 1 array another? postgres code: a1 := '{1, 2, 5, 15}'::int[]; a2 := '{1, 2, 3, 6, 7, 9, 15}'::int[]; a3 := a2 ??magic_operator?? a1; in a3 expect '{3, 6, 7, 9}' final result my , lad2025 solutions works fine. solution array_position() required postgresql 9.5 , later, executes x3 faster. the additional module intarray provides simple , fast subtraction operator - integer arrays, magic_operator looking for: test=# select '{1, 2, 3, 6, 7, 9, 15}'::int[] - '{1, 2, 5, 15}'::int[] result; ?column? ----------- {3,6,7,9} you need install module once per database: create extension intarray; it provides special operator classes indexes: postgresql intarray error: undefined symbol: pfree note only works for: ... null-free arrays of integers.

sql - How do i return the Most Recent Event in a series of same title events -

i have situation need able return recent of occurrence may or may not have occurred more once. instance: each time product moved position position b, recorded (from_function) / (to_function) along operator , timestamp. on rare instances - re-work required , unit show same / instance different time stamps. i calculating age in each position datediff, how return recent in scenario? i got down if there no group clause return date needed max(route_date_time) however,,, the total qry many lines long aggregate functions group necessary, how can return 1 line needed recent date. i've found rank() useful in finding oldest/newest dates. i'd try like: with cte (select [fields] rank() over(partition [product] order [datetime] desc) rankno table) select [fields], [aggregates] cte rankno = 1 group [fields] this rank product/datetime 1 being recent datetime , increasing there. if provide table structure , sql version i'll update qu

javascript - jQuery why don't I get any output in the console -

i need have variable values change on window.resize() , add them global variable. when try output variable section1 dont´t output in console , don´t understand why. nice if can help. $(document).ready(function() { var windowheight = $(window).height(); var section1, section2, section3; $(window).resize(function(){ windowheight = $(window).height(); section1 = windowheight; section2 = windowheight * 2; section3 = windowheight * 3; log(); }); function log() { console.log(section1); } }

materialize - How to align label with select in MaterializeCSS? -

Image
i'm trying create multiple select materializecss. html looks this: <div class="input-field"> <select multiple> <option value="" disabled selected>choose option</option> <option value="1">option 1</option> <option value="2">option 2</option> <option value="3">option 3</option> </select> <label>brands</label> </div> activate select: $('select').material_select(); unfortunately result looks this: while examples this . how come? i had problem well. make sure input-field contained within div class row , make sure input-field has col , size class: <div class="row"> <div class="input-field col s12"> ... if doesn't work, make sure other classes of form or other divs match of examples on materialize website.

java - Cash Register Change Issue -

the below code not calculating best way distribute change in java 'cash register'. how fix it? public void generateusdchange(){ change = payment-purchase; quarters = (int) (change/.25); change -= (quarters * .25); dimes = (int) (change/.1); change -= (dimes * .1); nickels = (int) (change/.05); change -= (nickels * .05); pennies = (int) (change/.01); changeamount = quarters*.25 + dimes*.1 + nickels*.05 + pennies*.01; if(changeamount != (payment-purchase)){ pennies++; if(pennies>=5){ nickels++; pennies-=5; } if(nickels>=2){ dimes++; nickels-=2; } if(((dimes*.1) + (nickels*.05)) >= .25){ quarters++; dimes-=2; nickels--; } } } as others suggested double , floats not currency. can use bigdecimal. here's working code: import java.math.bigdecimal; import java.util.linkedhash

sockets - SIGPIPE Error when using write() -

i getting sigpipe error when try write file descriptor returned when opened usb device. can read day it, cannot write it. below code: #include <fcntl.h> #include <unistd.h> #include <iostream> #include <sys/socket.h> #include <string> #include <stdio.h> #include <sstream> #include <pthread.h> #include <string.h> #include <signal.h> #include <errno.h> void* thread(void*); int fd = -1; std::string mastername; std::string slavename; int main() { char buf[1024]; fd = open("/dev/usbdevice", o_rdwr | o_noctty); pthread_t thread; pthread_create(&thread, null, thread, (void*)null); while(1) { int returnval = read(fd, buf, sizeof(buf)); if(returnval <= 0) { std::cout << "read() returned 0 bytes." << std::endl; break; } std::cout << "buffer data: " << bytechars << std::

for loop skips one round on reading values to char array in c++ -

so got weird thing that's happening me. have 2 dimensional char array, i'm suppose put values in array following conditions: each word (string) should in different array (different line) "." indicator end of input. this code: const int max_strs = 10, max_str_len = 8; int main() { char dict[max_strs][max_str_len] = { 0 }; getarray(dict); return exit_success; } void getarray(char array[][max_str_len]) { bool dot = false; int i, j; ( = 0; < max_strs && !dot; i++) ( j = 0; j < max_str_len && !isspace(array[i][j - 1]); j++) { array[i][j] = cin.get(); if (array[i][j] == '.') { dot = true; break; } } } the line i'm trying read is: blabla picked nice peter hahaha of pickled piper . for reason every time i=8, j automatically has same value (j=8) , skips round of loop. help appreciated! the pr

ios - How to compare between three objects in array? -

in card matching game (following stanford course) required create uiswitch change game mode between matching 2 cards 3 cards matching, have matching method looks this: -(int)match:(nsarray *)cardtomatch { int score = 0; if (cardtomatch.count == 1) { playingcards *acard = [cardtomatch lastobject]; if ([acard.suit isequaltostring: self.suit]) { score = 1; } else if (acard.rank == self.rank) { score = 4; } } return score; } it's array, i'm checking between 2 cards. how can improve method check 3 too, or create separate one? this method checking cards have been flipped: -(card *) cardatindex:(nsuinteger)index { return (index < self.cards.count) ? self.cards[index] : nil; } #define flip_cost 1 #define mismatch_penalty 2 #define bonus 4 -(void) flipcardatindex:(nsuinteger)index { card *card = [self cardatindex:index]; if (!card.isunplayable) { if (!card.isfaceup)

How do I perform a remote build for iOS using PhoneGap on Windows? -

this first hybrid app. i'm getting dozen of these error message c:\users\chloe\workspace\typefunctions>phonegap remote build ios [phonegap] compressing app... rm: not remove file (code ebusy): c:\users\chloe\workspace\typefunctions\build\www/lib/images/icons-svg/mail-black.svg there 1 search result on entire web. my target platform windows 8.1. using phonegap 5.4.0. strange, tried again, got different error. no mention of error though. terrible software. c:\users\chloe\workspace\typefunctions>phonegap remote build ios [phonegap] compressing app... skipping existing file: mail-black.svg skipping existing file: tag-white.svg skipping existing file: user-black.svg skipping existing file: user-white.svg [phonegap] uploading app... [phonegap] building app... [error] error occured while building ios app i managed stack trace. error: enotempty: directory not empty, rmdir 'c:\users\chloe\workspace\typefunctions\build' @ rethrow (fs.js:48:21) @ mayb

Dealing with multiple JSON result sets in R -

i'm trying json data of nba box scores. issue i'm having json data box score has 3 result sets , care 1 of them. test<- "http://stats.nba.com/stats/boxscoretraditionalv2?endperiod=10& endrange=14400&gameid=0021500580&rangetype=2&season=2015-16& seasontype=regular+season&startperiod=1&startrange=0000" library(jsonlite) json_data <- fromjson(paste(readlines(test), collapse="")) str(json_data) i care result set name "playerstats" , want make dataframe of it. i'm not sure how specify or exclude other 2 result sets. if me out question great! you try this, worked me: df <- data.frame( json_data$resultsets[ 1 , "rowset" ] ) names(df) <- unlist( json_data$resultsets[ 1 , "headers" ] ) when working lists can use $ in order dig down lower levels.

python - APscheduler doesnt execute jobs when added from a wrapper function -

def print_hello(what): print 'remind working' print def test(sender,kw): regex="remind me (to) (?p<reminder_text>.*?) (at|on|in) (?p<remind_time>.*)?" m=re.match(regex,kw['text'],re.dotall) if m: what=m.group("reminder_text") when=m.group("remind_time") when=nt.parse_natural_time(when) print when scheduler.add_job(print_hello, 'date', name='testme', run_date=when,args=[what]) scheduler.print_jobs()` the job gets added scheduler job doesn't run. however when execute this: def print_hello(what): print 'remind working' print def test(sender,kw): regex="remind me (to) (?p<reminder_text>.*?) (at|on|in) (?p<remind_time>.*)?" m=re.match(regex,kw['text'],re.dotall) if m: what=m.group("reminder_text") when=m.group("remind_time") when=nt.parse_natural_time(when) print when scheduler.print_jobs() s

python - Seaborn barplot with 2 bars with the same label -

Image
i using seaborn python3 create horizontal barplot, so: #!/usr/bin/python3 import seaborn sns import matplotlib.pyplot plt if __name__ == '__main__': names = ['alice', 'bob', 'bob'] values = [3, 2, 1] sns.barplot(x = values, y = names) plt.savefig('seaborn_figure.png') sometimes, 2 bars have same label (as in example above), leads seaborn draw 2 datapoints label 1 bar error bar: i prefer seaborn not combine values (i.e. particular chart should have 3 horizontal columns, 2 of them labeled bob). i've tried setting xerr = none in sns.barplot() call, changes nothing. it better if did not have label duplication, unfortunately names set people outside of sphere of influence. of course around renaming datapoints (e.g. "bob 1" , "bob 2"), not elegant solution. is there way force seaborn draw many bars there labels/values, if labels identical? you can following: names = ['a&

sql - How to Insert N Records in a Single Stored Procedure Call -

how accomplish being able insert unknown number of records database using single stored procedure call? say have table definition: create table phone( phoneid int identity(1,1), phonenumber varchar(20), personid int ) and have following insert stored procedure: create procedure dbo.usp_phone_insert @phonenumber varchar(20), @personid int insert phone values (@phonenumber, @personid) how able transform insert number of records in single call stored procedure? i have blog posts code samples address topic. performance comparison of singleton, xml, , tvp inserts http://sqlfool.com/2008/11/performance-comparison-of-singleton-xml-and-tvp-inserts/ bulk inserts xml http://sqlfool.com/2008/11/bulk-inserts-with-xml/ one-to-many inserts table-valued parameters http://sqlfool.com/2008/11/one-to-many-inserts-with-table-valued-parameters/ hth.

cloudflare - Cloud flare 301 partially working -

Image
i have .htaccess 301 redirect cloud flare redirects main page not other pages. ex. when domain.com redirects https://domain.com when open domain.com/new-page-html , not redirect https: below code: rewriteengine on rewritecond %{http:x-forwarded-proto} =http rewriterule ^ https://%{http_host}%{request_uri} [l,r=301] thanks in advance i think better off doing redirect in cloudflare "page rule". way traffic redirected before arrives server. have special rule http -> https redirection. see: how redirect visitors https/ssl? on cloudflare update: cloudflare has "always use https" switch now. can setup http://domain.com/ * , flip on switch , that's it!

c# - boolean not updating with code in Unity -

i have script changes score randomly. , b. want scores change button type false true depending on condition. reason won't change. unless scores even, last script should continually change true or false. want these last until next button pushed. i have printed out information, know scores being pulled in don't seem calculating. public static bool yaybutton = false; public static bool boobutton = false; scoremanager.scoredisplaya; scoremanager.scoredisplayb; if(scoremanager.scoredisplaya > scoremanager.scoredisplayb){ yaybutton = true; } if(scoremanager.scoredisplayb > scoremanager.scoredisplaya){ yaybutton = true; } you set yaybutton true in both condition, first mistake. with code once 1 of variable become true, true think need turn other variable false. and code must in update() or fixedupdate() method detect new change of scoremanager. your final code should this: public static bool yaybutton = false; public static bo

php - Different timestamp on php_error.log -

i'm using mamp on macbook pro, , whenever took php_error.log each error timestap berlin i'm in south america. [16-jan-2016 03:06:40 europe/berlin] php parse error: the actual time when error happened 21:06. how can change timestamp? know not big deal easier debug when date correct. the timezone indeed set berlin somewhere in system or code. check /usr/local/etc/php/(version)/php.ini file , date.timezone setting. full list of supported timezones available here . modify setting if necessary , restart php process/server. if setting not present, it's idea fix now! check if 'europe/berlin' set somewhere in code. simple way in php files in folder: find . -name "*.php" -exec grep -h "europe/berlin" {} \;

postgresql - Using Transaction in Sequelize for Postgres -

i trying transaction sequelize in noodejs. using postgres database. when call testdel transaction autocommitted in testdel. if transaction autocommit set false. if pass variable t db.transaction testdel, wait manual commit / rollback. can without passing t function? make coding complicated. the coding following: db.transaction({autocommit: false}).then((t) => { args = {vctitle: {$ilike: '%ulie%'}}; let bodelete = true; testdelpost(t, args) .then(rersult =>{ if(rersult){ t.commit(); }else{ t.rollback(); } }) }); function testdel(args){ //the result got deleted , auto committed after destroy, //doesn't wait above transaction decide commit or rollback. //if pass t, , set traction: t in destroy, work expected return db.models.post.destroy({where: args}) .then(result =>{ if(result > 0){ return true; }else{ return fa

javascript - Slide images every 5 seconds -

this slideshow's images: <section id="mainfooter"> <div class="mainfooter"> <p class="margright">jaafari housseine &copy; 2013 <span>|</span> <a href="#!/page_privacy">privacy policy</a></p> <nav class="bgnav"> <ul> <li class="active"><a href="images/picture1.jpg"><img src="images/pagination_act.png" alt="" class="img_act"></a></li> <li><a href="images/picture2.jpg"><img src="images/pagination_act.png" alt="" class="img_act"></a></li> <li><a href="images/picture3.jpg"><img src="images/pagination_act.png" alt="" class="img_act">

c++ - operator<< working w/ temp variable, but not directly with function call -

i'm trying write std::ostream operator<< class. have function (taking advantage of rov) returns instances of class. my operator works when assign result of function call local variable, , pass local operator << , not when pass result in directly. what's going on here? simplified standalone example (test.cpp): #include <iostream> template <class t> class anobject{ public: anobject(t value) : m_value(value) {} t getvalue(){ return m_value; } protected: t m_value; }; template <class t> std::ostream & operator<<(std::ostream& os, anobject<t> & obj ) { os << obj.getvalue(); return os; } anobject<int> getobject() { return anobject<int>(5); } int main(int argc, char**argv) { // doesn't compile std::cout << getobject() << std::endl; // does.... //auto obj = getobject(); //std::cout << obj << std::endl; } compiler command (g++ version 4.8.4 on ub

html - How to slide-out a submenu from under the navigation bar using CSS transition? -

i've been trying create transition effect where, on hover, sub menu slides out underneath main navigation bar. far, i've got elements in place , wasted hours playing around different methods various posts, no avail. here jsfiddle . i'm guessing i'm gonna have rid of display: none -> display: block way of hiding submenu no transitions various other methods such transitioning max-height , opacity , pulling down massive top value etc have failed. inflated top value method, submenu slides on rather under , changing z-index values somehow pushes behind while turning background transparent. weird behaviour. i appreciate if explain me how go creating smooth slide-out transition sub-menu. thank you transforming scale or transitioning max-height: 0 better option navigational elements. jsfiddle if initial state of element "display: none" passed on in dom hide element (as children) assistive technology. also, can use sibling sectors sel

cakephp - Cake PHP shows Internal Server Error 500 -

following cakephp code in index.php file. when runs on server, shows internal server error 500 if (!defined('ds')) { define('ds', directory_separator); } if (!defined('root')) { define('root', dirname(dirname(dirname(__file__)))); } if (!defined('app_dir')) { define('app_dir', basename(dirname(dirname(__file__)))); } $vendorpath = root . ds . app_dir . ds . 'vendor' . ds . 'cakephp' . ds . 'cakephp' . ds . 'lib'; $dispatcher = 'cake' . ds . 'console' . ds . 'shelldispatcher.php'; if (!defined('cake_core_include_path') && file_exists($vendorpath . ds . $dispatcher)) { define('cake_core_include_path', $vendorpath); } if (!defined('webroot_dir')) { define('webroot_dir', basename(dirname(__file__))); } if (!defined('www_root')) { define('www_root', dirname(__file__) . ds); } if (php_sapi_

c++ - Remove cycles from connected graph by finding vertices and edges -

Image
how can remove cycles graph this? edge lengths one, , edges either vertical or horizontal. graph connected. i want compute smallest number of edges have removed in order graph contain no cycles. it helpful if included sample code (preferably c++, c or java). update: apparently have find number of vertices , edges. problem have gives set of instructions (down, left, up, down, left, left, up, down). start (0, 0) in coordinate plane , move 1 unit in specified direction. create graph. how number of vertices , edges set of instructions? since graph connected, if point is, write, to compute smallest number of edges need removed in order graph contain no cycles then don't need write algorithm. known result of removing cycles tree, , trees have same number of edges (the number of vertices minus one). if point enumerate remaining edges (or removed edges), can use dfs (depth first search). specificially, in output of dfs , need retain marked there "tree

amazon web services - Point Cloudflare DNS to AWS Route 53 -

i want point dns cloudflare aws route 53. did deleted records , added ns record ns-1579.awsdns-05.co.uk ns-880.awsdns-46.net ns-1425.awsdns-50.org ns-176.awsdns-22.com but not resolved. can't figure out whats wrong. to use cloudflare you'll need use cloudflare name servers -- other name servers domain need removed @ domain registrar. if happen using cname setup cloudflare (business plan , above) continue use amazon route 53, wouldn't using cloudflare dns in addition route 53 dns ...you'd use 1 or other.

jquery - Css selector does not work as I expected -

i've done search/google didn't lead anywhere. problem, have following html structure (just sample, list's length dynamic): <ul class="collection"> <a class="collection-item head">alvin</li> <a href="#" class="collection-item">alvin</a> <a href="#" class="collection-item">alvin</a> <a href="#" class="collection-item">alvin</a> <a class="collection-item head">alvin</li> <a href="#" class="collection-item">alvin</a> <a href="#" class="collection-item">alvin</a> <a href="#" class="collection-item">alvin</a> <a class="collection-item head">alvin</li> <a href="#" class="collection-item">alvin</a> <a href="#" class=&qu

php - Jquery: Option selected not work in rendered select list -

i had countries/state chained select box pulled database (rendered select list) , want specific option value remain selected when page redirected action. user input fields temporarily stored in session , fields able retained value, excepted country , state field. i couldn't find these pulled option tag (which rendered) appeared in view-sources, can view in chrome console , firebug, believe jquery cannot find particular option value perform action, whereas when hard-code options, below script working: append options function ajaxcall() { this.send = function(data, url, method, success, type) { type = type||'json'; var successres = function(data) { success(data); }; var errorres = function(e) { console.log(e); alert("error found \nerror code: "+e.status+" \nerror message: "+e.statustext); }; $.ajax({ url: url, type: method,

c++ - Vector Subscript out of Range During Projectile Creation -

there 2 microsoft visual c++ runtime library messages pop when attempt create projectiles while game running debug assertion failed! program: c:\windows\system32\msvcp120d.dll file: c:\program files (x86)\microsoft visual studio 12.0\vc\include\vector line:1201 expression: vector subscript out of range and debug assertion failed! program: c:\sfml-2.3.2\sfml\debug\sfml.exe file: c:\program files (x86)\microsoft visual studio 12.0\vc\include\vector line:1202 expression: "standard c++ libraries out of range" && 0 and message microsoft visual studio express 2013: unhandled exception @ 0x5b89a893 (msvcr120d.dll) in sfml.exe: invalid parameter passed function considers invalid parameters fatal. this occurs press space bar create projectile (green square). green square appears on screen should , message pops up. projectile @ point current code should behave green square paint brush, message pops up. here source code: main: int main ( ) { int coun

javascript - By default show first container -

hello friends found show hide div script on fiddle, script need use in project problem want show first container text default default shows nothing show on button click. 1 can me this, w'll b full. <div class="btn-group" data-toggle="buttons-radio"> <button id="btn-game" data-target="game_container" class="btn btn btn-primary" type="button">game</button> <button id="btn-video" data-target="video_container" class="btn btn btn-primary" type="button">video</button> <button id="btn-giveaway" data-target="giveaway_container" class="btn btn btn-primary" type="button">giveaway</button> </div> <div class="see se" id="game_container"> game stuff </div> <div class="see" id="video_container"> video stuff </div> <d

javascript - React component could not sync props which created by dynamic ReactDOM.render -

when use react+redux+immutable, issue: component created dynamic way, when props change, component not rerender. react bug? i deleted business code, react code here: http://codepen.io/anon/pen/gomoez or below: import react 'react' import reactdom 'react-dom' class extends react.component { constructor(props) { super(props); this.state = { name: 'tom' } } dynamic() { reactdom.render(<b name={this.state.name} changename={this.changename.bind(this)} type={false}/>, document.getelementbyid('box')) } changename() { this.setstate({ name: 'tom->' + date.now() }); } render() { return <div> top name: {this.state.name} <b name={this.state.name} changename={this.changename.bind(this)} type={true}/> <div id="box"></div> <button onclick={this.dyna

C++ assignment to boost::python::object doesn't work. Why? -

according documentation , assignment here should work, doesn't: #include <boost/python.hpp> #include <iostream> int main(int, char **) { using namespace boost::python; py_initialize(); object test = object(2.05); //this works fine test = 3.05; //compiler error std::cout << extract<double>(test) << std::endl; py_finalize(); return 0; } here's compiler output: g++ -std=c++1y -i/usr/local/cellar/python3/3.5.0/frameworks/python.framework/versions/3.5/include/python3.5m -i/usr/local/cellar/boost/1.59.0/include -o0 -g3 -wall -c -fmessage-length=0 -mmd -mp -mf"test.d" -mt"test.d" -o "test.o" "../test.cpp" ../test.cpp:9:10: error: no viable overloaded '=' test = 3.05; ~~~~ ^ ~~~~ /usr/local/cellar/boost/1.59.0/include/boost/python/object_core.hpp:241:9: note: candidate function (the implicit move assignment operator) not viable: no known convers

Routing error in ASP.NET MVC 4 -

i have stumbled upon curious behavior in asp.net mvc routing. in routeconfig file, when map route (the default route): routes.maproute( name: "default", url: "{controller}/{action}/{id}", defaults: new { controller = "home", action = "index", id = urlparameter.optional } ); using: @html.actionlink("index", "home") i nice, clean , short url, like: http://mysite/ but if add optional parameter after id , this: routes.maproute( name: "default", url: "{controller}/{action}/{id}/{name}", defaults: new { controller = "home", action = "index", id = urlparameter.optional, name = urlparameter.optional } ); the same actionlink outputs url: ht

php - Using raw MYSQL queries in symfony -

i'm working symfony instead of using doctrine use raw mysql queries. $query1 = "select sport_id coach id = $id"; $statement1 = $connection->query($query1); $statement1->execute(); $sport_id = $statement1->fetch(); for above query gives error "notice: array string conversion 500 internal server error - contexterrorexception" can please explain wrong this? i'm beginner in symfony

ruby on rails - Why on deployment I have 'development' database is not configured. Available: ["production"]? -

when i'm trying bundle exec sidekiq see 'development' database not configured. available: ["production"] . why development database, if i'm deploying app server , need production ? last time hadn't problem.. look? edit console after $ /var/www/vkgazer/code# bundle exec sidekiq 'development' database not configured. available: ["production"] /var/www/vkgazer/code/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:248:in `resolve_symbol_connection' /var/www/vkgazer/code/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:211:in `resolve_connection' /var/www/vkgazer/code/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:139:in `resolve' /var/www/vkgazer/code/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active

java - Gcm Notification only comes in my own device -

i new in gcm , want send notification using gcm spacific users of app notification comes in own device here code mainactivity.java public class mainactivity extends actionbaractivity { private googlecloudmessaging gcm; string regid; checkbox isdriver; httppost httppost; stringbuffer buffer; httpresponse response; httpclient httpclient; list<namevaluepair> namevaluepairs; string user_name = ""; private final static int play_services_resolution_request = 9000; string tag = "mainactivity"; string sender_id = "224163385438"; string api_key = "aizasycl3rek_onegldhcp8giso_5p6xwe3guva"; utils utils; private context context = mainactivity.this; private progressdialog pb; private edittext username; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); util