Posts

python - How to select all URLs in a web site excluding those of a given class? -

i select urls twitter followers page using regex. if use https://twitter\.com/.* select urls matching pattern in website, i'd exclude users on follow section. urls within whotofollow class. so, question is: can use xpath, regex or combination of both select urls matching previous pattern excluding urls within whotofollow class in python? thanks! dani if correctly understood, can use such xpath, taking a tag not class whotofollow , having url beginning https://twitter.com/ . takes content of href //a[not(@class="whotofollow") , starts-with(@href, "https://twitter.com/")]/@href

python - What is the point of initializing extensions with the flask instance in Flask? -

following miguel grinberg's book flask web development, have initialize alot of exetensions flask instance point of doing this? examples app = flask(__name__) manager = manager(app) bootstrap = bootstrap(app) moment = moment(app) you can @ source of each of extensions see they're doing. in general, setting configuration, setting callbacks before , after request events, , using information app initialize. if don't pass app (or later call init_app ), extension can't finish initializing , unusable.

javascript - Gracefully Handle Tel URL -

i have link on website: <a href="tel:0123456789">call me, maybe</a> that's great browsers can initiate calls degrades elegance of hippopotamus. like: <h1>the address wasn't understood</h1> i thought of attaching on onclick listener , showing popup number. however, although listener runs, browser still follows url (and shows error) , i don't think there's reliable way detect whether there's tel: protocol handler. is there solution this? i think work see if device automatically wraps telephone number. <div id="testtel" style="display:none">+1 (111) 111-1111</div> var istelsupported = (function () { var div = document.queryselector("#testtel"), hasanchor = document.getelementsbytagname("a").length > 0; div.parentnode.removechild(div); return hasanchor; }()); alert(istelsupported);

How to resolve "GitLab: API is not accessible" when pushing to a new repository? -

we have locally-hosted enterprise edition of gitlab @ place of employment (currently @ v7.12.00-ee ceb5083). can create repository through gui without issue. when try add repository, error: d:\ws\testing [master]> git push -u origin master counting objects: 3, done. writing objects: 100% (3/3), 219 bytes | 0 bytes/s, done. total 3 (delta 0), reused 0 (delta 0) remote: gitlab: api not accessible http://gitlab.ops.cld/duffrw/testing.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed push refs 'http://gitlab.ops.cld/duffrw/testing.git' i see in /var/log/gitlab/gitlab-shell/gitlab-shell.log file api isn't responding, , giving "internal server error": e, [2015-07-22t16:05:51.812454 #15110] error -- : api call <post http://127.0.0.1:8080/api/v3/internal/allowed> failed: 500 => <{"message":"500 internal server error"}>. a few questions... can go here? there must sort of service provid...

tcp - vb.net - how create p2p connection without port forwarding (over internet)? -

first sorry bad english. :) i'm trying create p2p chat based on ip address , client application in vb.net. here tutorial used base chat forms, or similar codes i need port forward connection port in router send/receive messages. there other way create based on ip address , chat client app? skype, old god msn messenger? so without port forwarding , without server side app, want directly client client connection. i found similar questions here, this , know how create that? give example or something? thank you.

categories - Wordpress: How do I remove the category "uncategorized" from all posts in bulk? -

scenario: i have 1000 posts have "uncategorized" category, , want remove "uncategorized" of posts , set different category posts. in other words– take uncategorized posts , move them category, in 1 fell swoop. can in bulk without going through each post individually? what looking wordpress bulk editor. go posts > categories > uncategorized click "screen options" tab in top right corner, change "number of items per page:" 1000. (if on slow server might consider doing less @ time) now select of items on page , click "bulk actions" drop-down above select , select "edit” option. hit apply in bulk editor click “new category” want change of posts , hit update. once have added of posts “new category” need remove “uncategorized” category. this: go settings > writing now change “default post category” besides “uncategorized” go posts > categories , delete “uncategorized” category now can create...

python - Set value for particular cell in pandas DataFrame with iloc -

i have question similar this , this . difference have select row position, not know index. i want df.iloc[0, 'col_name'] = x , iloc not allow kind of access. if df.iloc[0]['col_name] = x warning chained indexing appears. for mixed position , index, use .ix . need make sure index not of integer, otherwise cause confusions. df.ix[0, 'col_name'] = x update: alternatively, try df.iloc[0, df.columns.get_loc('col_name')] = x example: import pandas pd import numpy np # data # ======================== np.random.seed(0) df = pd.dataframe(np.random.randn(10, 2), columns=['col1', 'col2'], index=np.random.randint(1,100,10)).sort_index() print(df) col1 col2 10 1.7641 0.4002 24 0.1440 1.4543 29 0.3131 -0.8541 32 0.9501 -0.1514 33 1.8676 -0.9773 36 0.7610 0.1217 56 1.4941 -0.2052 58 0.9787 2.2409 75 -0.1032 0.4106 76 0.4439 0.3337 # .iloc get_loc # =================================== df.iloc[0, df.co...