Posts

javascript - How to store images out of meteor project on live server but access them from web -

i have small meteor project image library. have 100k images uploaded on server , use them in project. when create bundle images inside /public/img/ folder, resource entries present inside bundle\programs\web.browser\program.json makes ~40mb. when try start server live on vps server, not start unfortunately. so need suggestion how manage these images accessed web using meteor? note : know little s3 storage, want keep simple , on server. using s3 doesn't have complicated. can set , solve issue having. i'd recommend read this great article meteor chef find out how use s3!

python 3.x - Values are not equal when they should be -

here snippet of code asking user input. issue evaluation of current month. if current month input, gooddate should = 0. reason not evaluating equal. tried making variables integers strings, 08 doesn't equal 08 current month reason. let me know if isn't clear enough. #!/usr/bin/python3 import time month = str(time.strftime("%m")) # user input print("""starting time time format - month/day hours:minutes - example 7/21 08:00 option - leave month out, keep / - example /21 08:00""") date1 = input("enter starting time -> ",) # split / x = date1.split('/') # evaluate if current month user entered. print("x value=", x[0]) print("month value=", month) if month == x[0]: gooddate1 = 0 else: start_replacement1 = month+date1 gooddate1 = 1 print("gooddate value=", gooddate1) the problem appears forgot indent second last line: gooddate1 = 1 . right gooddate1 aways 1 inste...

python - Spoofing bytes of a UDP checksum over network -

i'm trying play security tool using scapy spoof ascii characters in udp checksum. can it, when hardcode bytes in hex notation. can't convert ascii string word binary notation. works send bytes of "he" (first 2 chars of "hello world"): sr1(ip(dst=server)/udp(dport=53, chksum=0x4865)/dns(rd=1,qd=dnsqr(qname=query)),verbose=0) but whenever try use variable of test2 instead of 0x4865 , dns packet not transmitted on network. should create binary ascii: test2 = bin(int(binascii.hexlify('he'),16)) sr1(ip(dst=server)/udp(dport=53, chksum=test2)/dns(rd=1,qd=dnsqr(qname=query)),verbose=0) when print test2 variable shows correct binary notation representation. how convert string such he shows in checksum notation accepted scapy, of 0x4865 ?? i able working removing bin(). works: test2 = int(binascii.hexlify('he'),16)

ios - swift CollectionView cell textLabel auto resize -

Image
i have watch lot of yt tutorials uicollectionview , uitableview, app searching made watching , reading several tutorials, there 1 problem can not find. this app made user decide username , wrote text username. have made firebase, connect everything, post getting app, problem is showing 2 lines of text. this how look, can imagine better: i textlabel above username expands towards down full text written inside. number of lines on text label set 0. have tried several things in storyboard, lot of different codes , approaches, result same. should in tableview? thought collectionview better approach , easier design-wise. here codes page vc: import uikit import firebase class feedviewcontroller: uiviewcontroller, uicollectionviewdelegate, uicollectionviewdatasource { @iboutlet weak var collectionview: uicollectionview! override func viewdidload() { super.viewdidload() loaddata() } var fetchposts = [post]() override func didreceivememory...

angular - Setting Start / End Time in Primeng Schedule -

i adopt primeng schedule component https://www.primefaces.org/primeng/#/schedule , looking example of 'rich' event details editor dialog. primeng 'event details' popup sample displays date 'yyyy-mm-dd' event , need able set / edit event start , end time well. in spirit of 'dry' believe must have been done others before me! can point me example can see working model? i see there older sample based on underlying fullcalender jquery component upgraded angular here: https://www.alinous.org/web-developer/design-pattern/fullcalendar/ . failing else guess start that. ok - can answer own question. the embedded p-calendar component in p-dialog html sample code can updated accommodate adding showtime attribute , setting value "true". the source sample html https://github.com/primefaces/primeng/blob/master/src/app/showcase/components/schedule/scheduledemo.html can modified show time picker: to started change this: <div class...

machine learning - Visualizing the Model using export_graphviz from .pkl file -

i have exported model .pkl file. trying import via joblib imports in form sklearn.model_selection._search.gridsearchcv . however not able use sklearn.tree import export_graphvizexport_graphviz expects tree_ first parameter. is there way this? here code: export_graphviz(model,out_file="out.dot") traceback (most recent call last): file "", line 1, in file "/home/anaconda3/lib/python3.6/site-packages/sklearn/tree/export.py", line 433, in export_graphviz recurse(decision_tree.tree_, 0, criterion=decision_tree.criterion) attributeerror: 'gridsearchcv' object has no attribute 'tree_' how did define gridsearchcv , train it? most underlying tree in gridsearchcv can accessed by:- decision_tree.best_estimator_.tree_ if decision_tree gridsearchcv object

google navigation intent kills the background service android -

background service stopped after time due google navigation intent open. background service using gps tracking. code as public class longbackgroundintentservice extends intentservice { private static final string tag = "map"; windowmanager windowmanager; imageview back; windowmanager.layoutparams params; private locationlistener locationlistener; private locationmanager locationmanager; private context context; public static final long min_time_bw_updates = 1500; // sec public static final long min_distance_change_for_updates = 10; // meters public longbackgroundintentservice() { super(null); } public longbackgroundintentservice(string name) { super(name); //setintentredelivert(true); } @override public void oncreate() { super.oncreate(); context = this; devicegpslocation(); windowmanager = (windowmanager) getsystemservice(window_service); = n...