Posts

python - If and only if all given conditions are true -

import numpy np def data_verify(source): rows = [x.strip().split(' ') x in open(source)] columns = zip(*rows) blocks = np.array(rows).reshape((3,3,3,3)).transpose((0,2,1,3)).reshape((9,9)) #check iff, see further return rows, columns, blocks else: return false got sudoku grid in txt such: 3 2 7 4 8 1 6 5 9 1 8 9 3 6 5 7 2 4 6 5 4 2 7 9 8 1 3 7 9 8 1 3 2 5 4 6 5 6 3 9 4 7 2 8 1 2 4 1 6 5 8 3 9 7 8 1 2 7 9 3 4 6 5 4 7 5 8 1 6 9 3 2 9 3 6 5 2 4 1 7 8 the function collects relevant data , return respective rows, columns , blocks iff length of rows same columns' (got few other functions determine whether puzzle legit). figured enough compare first row columns (or vice versa, doesn't make difference). how can create check goes like: for in range(len(rows)): if len(row[0]) == len(column[i]): #do if of lengths check out use all : if all(len(row[0]) == len(colum...

javascript - if element has opacity=1 not working -

i have piece of code that's not working , can't figure out why. here's simplified code: html: <div id="objinfo"> <div id="button"></div> <img src="img/x.png" class="obj_x"> </div> css: #objinfo { opacity: 0; display: none } javascript: if ($('#objinfo').css('opacity') != "1") { $("#button").click(function(){ $("#objinfo").css("display", "block"); $("#objinfo").animate({opacity: 1, top: "-25px"}); }); } else { $(".obj_x").click(function(){ $("#objinfo").css("display", "none"); $("#objinfo").animate({opacity: 0, top: "+25px"}); }); } so basically, wanna have popup (#objinfo) appears when #button clicked , disappears when .obj_x clicked. , also, want #objinfo disappear when click outside of...

Android stack is not getting clear -

i have got stuck in situation please me .here problem .i have menu screen in application.now have given option go menu screens has not come directly menu screen .for example go activity b menu ->activity -->activity b. have written on pressing backtomenu button. this.finish(); startactivity(new intent(selectstateactivity.this,menuscreen.class).setflags(intent.flag_activity_clear_top)); i not finishing activity because want on activity when press button on activity b.so on stack when press menu button on activity b. come menu screen fine when press on menu screen come activity a.which not wanted.i tried this.finish(); startactivity(new intent(selectstateactivity.this,menuscreen.class).setflags(intent.flag_activity_clear_task|intent.flag_activity_clear_top)); and startactivity(new intent(selectstateactivity.this,menuscreen.class).setflags(intent.flag_activity_clear_task|intent.flag_activity_new_task)); but haven't worked.please me. you can solve issue...

Facebook friends list is empty, just for one specific user -

simply executing query aiming list friend's friends: get https://graph.facebook.com/hisfacebookuserid/friends?return_ssl_resources=1&access_token=hisaccesstoken i obtain empty data entry. => if had 0 friends. (but has 800). however, works many other users. what might reason? since v2.0 of facebook api, can friends authorized app too. it´s (privacy) feature, not bug. https://developers.facebook.com/docs/apps/changelog also, it´s not necessary use id call, because can friends of authorized user anyway: /me/friends btw, don´t forget authorize users user_friends permission.

android - When exchange Activity black screen -

i have problem when call activity. screen goes black, , when done preload layout shows activity. the problem layout needs load heavy. how can manage thing not good? this code, tried various tests: 1 syncronize 2 asinktask if (tab.getposition() == 0) { /* * ----------------- tab data ----------------- */ try { system.gc(); //initialize class needs load activity mylayout = new tablemainlayout(this); //i tried give time load, that's not good! synchronized (this) { wait(5000); } setcontentview(mylayout); } catch (exception e) { log.i("link", "errore actionbartabs update series: " + e); } } but no avail. can tell me solution? or advice? edit : update code: tablemainlayout.java my problem can not figure out when layout ready. tried put in async nothing, tried syncronize nothing....

ios - Redefinition of enumerator in two seperate frameworks -

i have 2 frameworks included in 1 of files #import "sclalertview.h" #import "actionsheetstringpicker.h" these frameworks unfortunately fighting against each other , trying define same constant. typedef ns_enum(nsinteger, sclactiontype) { none, selector, block }; typedef ns_enum(nsinteger, actiontype) { value, selector, block }; is there easy solution redefinition of enumerator? change code, prefer not to, since update of frameworks revert changes , require me redo once again. thank in advance. i've removed 1 of frameworks.

tableview - JavaFX8 - Remove highlighting of selected row -

Image
when click on row within tableview row highlighted blue. how possible disable feature? i've tried set background white, problem row-color isn't white in every row. know do? best regards edit: in image below see blue color of second row. highlighting should removed. if want (i agree @kleopatra in comments make life difficult user) can revert colors selected rows external css file: .table-row-cell:filled:selected { -fx-background: -fx-control-inner-background ; -fx-background-color: -fx-table-cell-border-color, -fx-background ; -fx-background-insets: 0, 0 0 1 0 ; -fx-table-cell-border-color: derive(-fx-color, 5%); } .table-row-cell:odd:filled:selected { -fx-background: -fx-control-inner-background-alt ; }