Posts

Showing posts from April, 2012

html - How to allign 3 divs next to each other in the middle? -

Image
i have 3 divs next each other, aren't nice alligned. leaning towards top instead of middle. what want: what now: as can see, current 1 isn't alligned good.the paragraphs needs higher , on. may seem subtle thing, when open in different sizes of screens looks unorganized , messy. so how make first picture ? anyone got ideas ? .capital { margin: 0px 0 -5px 0; line-height: 63px; font-size: 60px; font-weight: ligter; } .smalltext { text-align: center; margin-top: 0px !important; font-weight: 100px; font-size: 14px; } .container { float: left; margin: 0 auto; width: 100%; display: flex; } .left { width: 25%; margin: 05% 00% 00% 02%; } .imageleft { float: left; } .paragraphs { margin: 5% 00% 2% 00%; width: 50%; } .imageright { float: right; margin: 02% -10% 0% 00%; width: 300px; height: 200px; } .square { border-radius: 25px; background: #769dbd; padding: 20px; w

javascript - Can't select element's value loaded by PHP from Database -

i have enlisted data database using php. i'm unable select element's value. although data loaded in dom. if write html markup i'm able select other <?php $results = $mysqli->query("select product_code, product_name, product_desc, product_img_name, price products order id asc"); if($results){ $products_item = '<ul class="products">'; //fetch results set object , output html while($obj = $results->fetch_object()) { $products_item .= <<<eot <li class="product"> <form method="post" onsubmit="return false"> <div class="product-content"><h3>{$obj->product_name}</h3> <div class="product-thumb"><img src="images/{$obj->product_img_name}"></div> <div class="product-desc">{$obj->product_desc}</div> <div class="product-info"> price {$currency}{$obj

python - Getting a random document from MongoDB using MongoAlchemy -

i attempting fetch random document api call , can't find suitable solution it. guessing first need find amount of documents in collection , randomly select 1 of them? app.config['mongoalchemy_database'] = mongodb_db app.config['mongoalchemy_connection_string'] = mongodb_connection_string db = mongoalchemy(app) class randomdoc(db.document) ??? can 1 nudge me recommended solution?

ibm mq - Can MQIPT be configured to authenticate the credentials set by MQ client for a specific connection -

scenario: mqipt used in between mq client , mq server version 8. is possible validate credentials sent along channel connection @ mqipt. checked documentation , seems cannot done unless kind of security exit written it. just wanted views on this, how can achived if @ possible. thank you. the mqipt com.ibm.mq.ipt.exit.securityexit , com.ibm.mq.ipt.exit.certificateexit classes not expose username , password information client channel. below documentation ibm on these 2 types of exits. the com.ibm.mq.ipt.exit.securityexit class documented in ibm v9.0 knowledge center following information: public securityexitresponse validate(ipttrace) following properties available: listener port destination destination port timeout client ip address client port address channel name queue manager name the validate method called mqipt when receives connection request validate. channel name , queue manager name not available if s

javascript - Changing CSS proprety of another div located in another page -

hello change dom of html page page tried sharing same script between 2 pages didnt work here illustration trying do 1-first page <div> <p id="simpletext">hello world</p> <script src="jquery.min.js"></script> <script src="script.js" type ="text/javascript"></script> <!-- same script file present in second page --> </div> 2-second page <div> <button>click me </button> <script src="jquery.min.js"></script> <script src="script.js" type ="text/javascript"></script><!-- same script file present in first page --> </div> script.js $("button").on("click",function(){ $("simpletext").css("color","blue"); }); i trying when click on button wish located on second page change color of text on first page you can send messages 1 page another.

R Data.Table: In-memory left join multiple columns from left and right side -

i want merge 2 data tables on multiple columns using data table. ## 2 tables <- data.table(a = 1:4, b = 12:15, c = 10:13) b c 1: 1 12 10 2: 2 13 11 3: 3 14 12 4: 4 15 13 b <- data.table(a = 1:3, b = 12:14, d = 10:12, e = 10:12) b d e 1: 1 12 10 10 2: 2 13 11 11 3: 3 14 12 12 i result: a <- merge(a, b, = c('a', 'b'), all.x = t) b c d e 1: 1 12 10 10 10 2: 2 13 11 11 11 3: 3 14 12 12 12 4: 4 15 13 na na this answer showed data table can edit data frame in-memory, it's more efficient when using large data sets. code suggested is a[b, bb:=i.b, on='a'] how can alter code data frame merged in-memory, , result same above? if meant join . here i.d or i.e not needed columns unique in 'b' nm1 <- setdiff(names(b), names(a)) a[b, (nm1) := mget(nm1), on = .(a, b)] # b c d e #1: 1 12 10 10 10 #2: 2 13 11 11 11 #3: 3 14 12 12 12 #4: 4 15 13 na na

typescript - Updating items in a grid with checkbox - ionic 2 -

i hope can me. have grid many columns , need update in database selected rows pressing button. can't find info this. this code. <ion-row *ngfor="let errors of eta_allerrorsrs"> <ion-col class="info-col col-align" col-1> eta </ion-col> <ion-col class="info-col" col-1> <ion-checkbox ng-model="active"></ion-checkbox> </ion-col> <ion-col class="info-col col-align" col-1> sli </ion-col> <ion-col class="info-col col-align" col-1> odbms </ion-col> <ion-col class="info-col col-align" col-1> {{errors.vc_codi_iata_pais}} </ion-col> <ion-col class="info-col col-align" col-2> {{errors.nb_oc}} + "/" + {{errors.fech_i

.net - Is there a library to unzip .Z files using VB.NET? -

i need unzip list of .z files kept in folder using visual basic.net. example, consider there folder c:\filestobeunzipped . inside folder there 5 6 files .z extension. need unzip these .z files , save unzipped files in folder c:\unzippeddatafiles . is possible in vb.net? there free component or class library achive it? i ran issue well, needed decompress *.z file please note, not original author of however, wanted provide copy of source on stack overflow in case original site no longer available. the original post can found here here example of how use class: using system; using system.io; using ebixio.lzw; class mainclass { public static void main(string[] args) { byte[] buffer = new byte[4096]; string outfile = path.getfilenamewithoutextension(args[0]); using (stream instream = new lzwinputstream(file.openread(args[0]))) using (filestream outstream = file.create(outfile)) { int read; while ((re

c++ - How to use C# textbox inputs with C structs and imports -

i have library ( *.dll file) written in c. trying use windows form application building. have redefined struct needed import work. how can assign values variables in struct. [dllimport("hdnpic.dll")] public static extern int hidden(hid4cinp hid4cinp); [structlayout(layoutkind.sequential)] public struct hid4cinp { public const int maxsize = 500; public double alpha_c; public double alpha_m; public double alpha_y; public double alpha_k; public double freq; public double dsmp; public double cdxy; public double cdhi_c; public double cdhi_m; public double cdhi_y; public double cdhi_k; public double amp1; public double perd; public int funtype; public int smooth; public int inpres; public int width; public int height;

c# - How to find nodes before a given node with Roslyn? -

i developing roslyn analyzer detect use of specific method, method1 . want allow use of method in for , while loops, , create issue in other cases in code. how can that? code developed detects method1 everywhere. want each time find function, check if it's in loop or not, , generate error if not in loop. the method call descendant of loop declaration if inside it. can access ancestors property of syntaxnode . start going among ancestors of methodinvocation node detected until hit loop or member declaration. if hit loop ( forstatementsyntax or whilestatementsyntax ) good. if hit memberdeclarationsyntax node means have reached start of whatever block in method1 being called , should throw error. at point, immediate problem mostly solved, , have decide how many corner cases want cover. if called lambda expression? if method calls method1 called loop? or recursive method? you can detect these cases have decide if worth effort.

python - Performing grid search with a predefined validation set Sklearn -

this question has been asked several times before. error when following answer first specify part training set , validation set follows. my_test_fold = [] in range(len(train_x)): my_test_fold.append(-1) in range(len(test_x)): my_test_fold.append(0) and gridsearch performed. from sklearn.model_selection import predefinedsplit param = { 'n_estimators':[200], 'max_depth':[5], 'min_child_weight':[3], 'reg_alpha':[6], 'gamma':[0.6], 'scale_neg_weight':[1], 'learning_rate':[0.09] } gsearch1 = gridsearchcv(estimator = xgbclassifier( objective= 'reg:linear', seed=1), param_grid = param, scoring='roc_auc', cv = predefinedsplit(test_fold=my_test_fold), verbose = 1) gsearch1.fit(new_data_df, df_y) but following error object of type 'predefinedsplit' has no len() try replace cv = predefinedsplit(test_fold=my_test_fold) with cv = list(predefin

python - QuickSI algorithm for finding subgraph isomorphisms -

i studying quick subgraph isomorphism (quicksi) algorithm , having problem understanding formulae regarding inner support , average inner support calculation described @ page 6, (2) , (3). if "v" stands vertex , "e" stands edge, f(v) , f(e) do? how can obtain values of table 2 page 6? definition 4 page 5 not in helping me understand. isomorphic mappings query graph data graph understand taking different components query graph , see if can found in data graph. computation time not seem feasible large graphs. here can find original article: http://www.cse.unsw.edu.au/~lxue/10papers/vldb08_haichuan.pdf thank in advance! the function f described in definition 1 - it's isomorphism function preserved labels ( l ). the 'average inner-support' number of 'features' (for example, vertices) have isomorphism divided number of graphs have isomorphism. values of table, need know dataset of graphs ( d ) used. doesn't seem referenced exce

Memory leak on solr 3.6.2 indexing on NFS -

i have memory leak in solr 3.6.2 based app holds index on nfs. i've read it's not best practice hold solr index on nfs, got system heritage , can't change @ moment. once in every x (configurable) minutes, system "wakes up" , starts index data collected during sleeping time. reads files , solr indexes it. problem memory of solr app gets larger , larger every indexing cycle. crashes oom, after several indexing cycles. gclog graph i took heapdump several times , tried analyze using eclipse memory analyzer. "remainder" section large and seems consists of many org.apache.lucene.index.freqproxtermswriterperfield.freqproxpostingsarray unreachable objects: dominator_tree is source of leak or normal? another strange behavior more , more .nfs00000000000..... hidden files being generated in index directory (which located on nfs, noted before) every indexing cycle. these files take lot of disk space, , disappear when kill solr app. suspect has lea

ios - regEx expression for detecting javascript call function -

for example, there @"javascript:viewdata(3713, 'a', 89360)" string. i want extract 3713, , 89360 string. for java, " viewdata\(([^\(]*),[\s\s]\'([^\(]*)\',[\s\s]([^\(]*)\) " can extract strings successfully. however, couldn't extract them in ios objective-c. my code below: nsstring *searchedstring = @"javascript:viewdata(3713, 'a', 89360)"; nsrange searchedrange = nsmakerange(0, [searchedstring length]); nsstring *pattern = @"<here pattern needed>"; nserror *error = nil; nsregularexpression* regex = [nsregularexpression regularexpressionwithpattern:pattern options:0 error:&error]; nstextcheckingresult *match = [regex firstmatchinstring:searchedstring options:0 range:searchedrange]; then matched string as: [searchedstring substringwithrange:[match rangeatindex:1]] .. , on. how can set pattern? basically regex pattern supposed work in objective-c, too. however have escape bac

How to write jQuery or JavaScript equivalent for CSS -

i have jquery equivalent css when tab clicked shows content. now, i'm able css only. have same function jquery or javascript. for example, when sun clicked, shows "it sunday" , when mon clicked, shows "it monday" , on. how can have same functionality jquery or javascript? @import url('https://fonts.googleapis.com/cssfamily=open+sans:400,600,700'); * { margin: 0; padding: 0; } body { padding: 2px; background: #e5e4e2; } .tabinator { background: #fff; padding: 1px; font-family: open sans; margin-top: 10px; } .tabinator input { display: none; } .tabinator label { box-sizing: border-box; display: inline-block; padding: 5px 0.6%; color: #ccc; margin-bottom: -1px; margin-left: -1px; font-family: courier; font-weight: bold; } .tabinator label:before { content: ''; display: block; width: 100%; height: 15px; background-color: #fff; position: absolute;

swift - CocoaPod pod installed but not working -

i have installed sidemenu pod swift. i have run commands in terminal , says pod has installed , there 1 dependency. podfile follows: source 'https://github.com/cocoapods/specs.git' platform :ios, ’10.3’ use_frameworks! target ‘appname’ project ‘/users/name/documents/3/ios/app/appname’ pod 'sidemenu' end however, when open xcode pod doesn't work. have 'pod' file added project lot of stuff, including framework, appear red though missing. try import sidemenu in swift file , says no such module exists. there mssing? thanks

java - Soft Delete Procedure in MongoDB -

we going develop multi tenant based project, based on java spring boot @ backend , mongodb database. i want ask there procedure make soft delete other insert attribute true/false or 0/1 ? thanks help... if don't want delete or use attribute isdeleted or similar name. have move deleted documents collection namely deletedcollections , hard delete current document current collection. methodology can useful manage these unwanted or deleted data current collection. first create collection may in server or file system named deletedcollection first insert document collection deleted then delete current document current collection this way useful reach deleted or archived data in time.

c# - Toggle Between Displaying the wireframe of an object in Unity 3D -

i'm new unity , c# have searched enough deem there no solution available other using shader. (shaders aren't available on free version) so far, i've been able change whether model displayed in wireframe or not using following: // http://docs.unity3d.com/scriptreference/gl-wireframe.html using unityengine; using system.collections; public class exampleclass : monobehaviour { void onprerender() { gl.wireframe = true; } void onpostrender() { gl.wireframe = false; } } however doesn't let me toggle between 2 in-game required. i'm assuming solution re-render not sure if right approach. advice please? the reasonable solution use shaders are available in free version. since unity 5, pro , free versions different based on license; if game makes on $100,000 usd, need pay pro license. however, features available in both. update: apply shader need make sure model has been uv mapped (aka: unwrapping). process explains h

osx - Xcode: How to create a dSym and still strip symbols? -

i'd create dsym file when building release build i'd strip symbols in executable keep things away nosy eyes. possible both? or mutually exclusive? i'm using this: gcc_generate_debugging_symbols=yes, gcc_debugging_symbols = full, debug_information_format=dwarf-with-dsym, copy_phase_strip=yes, dwarf_dsym_file_name = "$(target_name).dsym", dwarf_dsym_folder_path = "$(configuration_build_dir)/dsyms" ...which create dsym file unfortunately keeps symbols in executable. ???

How to split a table into two in MySQL? -

i have table in mysql has data looks this: id date name gender age 1 2014/7/6 john m 33 2 2015/2/12 mike m 44 3 2001/2/9 emily f 57 . . . 500 2017/11/22 jasmine f 20 i want take bottom 200 rows , make them new table. how can that? insert `newtable` select * `oldtable` id > 300; assuming bottom 200 rows means when rows sorted id's

python - perfectly mimic inheritance with composition -

i attempting wrap class third-party package in such way new class looks subclass of third-party class. third-party class not support inheritance, , has nontrivial features, such functions have __getitem__ method. can wrap every attribute , method using solution based on wrapping class methods return instances of class , how can intercept calls python's "magic" methods in new style classes? . however, still need override __init__ method of third-party class. how can that? note: using new-style classes. code far: import copy class wrappermetaclass(type): """ works `wrapper` class create proxies wrapped object's magic methods. """ def __init__(cls, name, bases, dct): def make_proxy(name): def proxy(self, *args): return getattr(self._obj, name) return proxy type.__init__(cls, name, bases, dct) if cls.__wraps__: ignore = set("__%s__&

javascript - Canvas performance slow on Safari and IOS but running fine everywhere else -

i building infographic in canvas , experiencing poor performance on safari 10.1.1 , on ios not seeing issues elsewhere. animating 400 bitmaps across screen(on chrome able 10,000 bitmaps animating fine) , on safari , ios animations choking processor in 2 cycles. on safari @ least draws screen. on ios canvas not drawing. seeing no errors in console. un fortuantely can't share code work. has run poor performance animating bitmaps in canvas? getting slow performance 1 instance. sure doing wrong. in drawscreen function tested this: for(var = 0; i<100; i++){ this._context.fillstyle = this._color;//hex value string sans # this._context.beginpath(); this._context.arc(this.getrandom(500),this.getrandom(500),this.getrandom(50),0,math.pi*2); this._context.closepath(); this._context.fill(); } it works charm in other browsers in safari grinds halt.is there missing here?

oracle apex - How to combine tabular form and text area in one page? -

i have page, containing tabular data(region type sql query (updateable report)). updates existing rows using submit. wizard created applymru process. works fine. place text area in same page, bound different table , updated once same submit button pressed. how can accomplish it? i've created item text area, not sure type of source should set. database column doesn't let me specify table. guess need second after submit process, not sure one. keep existing applymru infrastructure tabular form, , define second pl/sql process executes during page submit whatever want text area, eg: insert notes (id, text) values (:p1_id, :p1_text_area); take note of order of processes, may want execute 1 before other.

node.js - Have to terminate all nodejs Instances for code reflect. how to fix this? -

i have developed application using typescript, hapi , nodejs whenever i'm saving removing, adding new code, code not getting reflected after doing gulp build after closing running nodejs instances thorugh task manager working fine. can suggest me why happening , how fix this? nodejs can run javascript, typescript compiler generating these javascript files. these files reflected in app have restart nodejs . there solutions automatically example: nodemon or better tsc-watch

html - Ruby Net::HTTP and iframe src -

currently i'm learning how html page, , have interesting question. example, have iframe on page , want data single net::http.get request. for example, loaded page looks that: <body> <h1>my page</h1> <iframe src='some_url'> <html> <head> ... </head> <html> </iframe> </body> but if net::http request only <body> <h1>my page</h1> <iframe src='some_url'></iframe> </body> is there way page sing net::http request?

ios - How do I rotate a node in scenekit based on the current camera angle -

i'm working on project want able use uipangesture rotate node based on current rotation of camera. example, user looking @ geometry attached node , decides rotate it. normally, geometry rotation based on (0, 0, 0) or (0, 0, 0, 0), able rotate along y axis y axis axis perpendicular camera angle, thereby treating whatever camera angle (0, 0, 0, 0). original solution rotate pivot point match camera angle, i'm not seeing in scenekit documentation allows me rotate pivot point @ all, i'm bit lost. advice on issue appreciated. ^_^

ios - Runtime error when pressing like button -

i want save number of likes , people liked in posts table under key of post invalid update: invalid number of rows in section 0. number of rows contained in existing section after update (1) must equal number of rows contained in section before update (1), plus or minus number of rows inserted or deleted section (1 inserted, 0 deleted) , plus or minus number of rows moved or out of section (0 moved in, 0 moved out). here image @ibaction func didtaplike(_ sender: any) { print("like tappppppppped") self.loggedinuser = auth.auth().currentuser let key = ref.child("posts").childbyautoid().key ref.child("posts").child(self.loggedinuser!.uid).observesingleevent(of: .value, with: { (snapshot) in if let post = snapshot.value as? [string : anyobject] { print(post) let updatelikes :[string:any] = ["userswholiked/\(key)" : auth.auth().currentuser!.uid] self.ref.child("posts").c

ldap - issue with apache upgrade 2.2 to 2.4 -

upgraded httpd 2.2 2.4 , getting error when try start httpd: ~]# /etc/init.d/httpd start starting httpd: httpd: syntax error on line 164 of /etc/httpd/conf/httpd.conf: cannot load modules/mod_ldap.so server: /etc/httpd/modules/mod_ldap.so: undefined symbol: ap_escape_html [failed] can how fix issue. using ldap on apache config cannot comment out module

mysql - "mysql_clear_password" plugin error when using knex but not when using mysql2 -

i trying connect mysql server using mysql_clear_password plugin. set connection configuration node-mysql2 follows: const connectionconfig = { host: rwconfig.host, user: rwconfig.user, database: rwconfig.database, ssl: { ca: sslcontent }, password } then support mysql_clear_password plugin added following (link of reference used: https://github.com/sidorares/node-mysql2/issues/438#issuecomment-255343793 ): connectionconfig.authswitchhandler = (data, cb) => { console.log('in auth switch handler'); if (data.pluginname === 'mysql_clear_password') { console.log(data); console.log(data.plugindata.tostring('utf8')); console.log('in mysql clear password'); var tmppassword = connectionconfig.password + '\0'; var buffer = buffer.from(tmppassword, 'base64'); cb(null, buffer); } }; this works when attempt connect database. now try similar using knexjs. use following configuration objec

php - ChartJS adding 3yAxes -

i try make chart, issue need more y-axis because stock data , reviews/price looks after try chart not loading, tried add: yaxisid: '#name#' each dataset. so want add y-axis price, 1 reviews , 1 rank. $(document).ready(function(){ $.ajax({ url : "/data.php", type : "get", success : function(data){ console.log(data); var stock = []; var price = []; var reviews = []; var date = []; for(var in data) { stock.push(data[i].stock); price.push(data[i].price); reviews.push(data[i].rating); date.push(data[i].scrape_date); } var chartdata = { labels: date, datasets: [ { label: "price", fill: false, linetension: 0.1, ba

c# - How Can I Use XMLDocument.SelectNodes in UWP -

i beginner in programming uwp applications, know c#. question is, how use selectnodes in uwp applications since definition doesn't exist... how work around issue? thanks. here code if needed xmldocument responsexml = new xmldocument(); responsexml.loadxml(response); string innertext = responsexml.selectnodes("//maininfo").item(0).innertext; responsexml.loadxml(innertext); info1 = responsexml.getelementsbytagname("upnp:info1").item(0).innertext; info2 = responsexml.getelementsbytagname("upnp:info2").item(0).innertext; info3 = responsexml.getelementsbytagname("dc:info3").item(0).innertext; info4 = responsexml.getelementsbytagname("dc:info4").item(0).innertext; how use selectnodes in uwp applications since definition doesn't exist... how work around issue? the problem have used wrong namespace( system.xml ) xmldocument . please use windows.data.xml.dom namespace. more refer xmldocument class official docu

brightscript - Roku SceneGraph TargetList last child animates incorrectly -

i running issue targetlist component provided roku scenegraph. targetlist's last child not animating correctly. on animation, last child turns different color. here clip of looks like. https://photos.google.com/share/af1qipmeeorvq9rs3tc0swuhmbqoaxrpogzk2dimvhdflpw7q1dw8hxchvg8spw6efov1a?key=cucytw9pvvlbemhvsjhjwuthdxhkedftagjtt1vn it doing last child in list. have tried 3 , 4 child list, same outcome. here targetlist xml: <?xml version="1.0" encoding="utf-8"?> <component name="rowt2targetgroup" extends="targetlist"> <interface> </interface> <script type="text/brightscript" > <![cdata[ function init() m.top.observefield("focusedchild", "focusedchildchanged") m.top.observefield("itemfocused", "itemfocusedchanged") m.top.observefield("itemunfocused", "itemunfocusedchanged") m.top.defaulttargetsetfocusindex =

r - remove rows of data based on one of any criteria -

i'm trying create association rules aprori algorithm between different error messages. there several errors not want consider, want remove rows contain these select errors. problem can remove 1 error using code below. mydata <-data[!(data$message=="errormessageone") ,] is there "or" operator can integrated in order remove lines containing of 12 or errors want exclude data. something following. mydata <-data[!(data$errormessage=="errormessageone or errormessagetwo or errormessagethree") ,] i know basic question has got me stumped. you can try: mydata <-data[!data$errormessage %in% c("errormessageone","errormessagetwo", "errormessagethree"),]

c++ - Difference between functional cast notation T(x) and static_cast<T>(x) -

this question has answer here: when should static_cast, dynamic_cast, const_cast , reinterpret_cast used? 6 answers (i know similar other questions on here, haven't found specifically, language-lawyerly, answer this precise detail . of near-duplicates asking whether should use static_cast on functional-style casts (answer: yes), or difference between static_cast , c-style casts.) in c++, following 2 casts appear similar: template<class t, class u> auto convert1(u&& u) { return t( std::forward<u>(u) ); } template<class t, class u> auto convert2(u&& u) { return static_cast<t>( std::forward<u>(u) ); } is there any difference types t , u ; or 100% identical in effect? if different, i'd appreciate examples of places in standard library subtle difference relevant. (i mean how std::make_shared<t&g

javascript - Ember.js: Component attribute not reset while testing -

i attempting acceptance test on nested route, makes use of same component twice, different arguments. works fine when run normally, run acceptance test, notice component's arguments aren't being updated, causes test fail. here sample code: in index.hbs have: {{index-view model=model type='location'}} my index-view component looks this: <h1>{{title}} list</h1> {{listing-table model=model type=type}} by clicking on element in listing-table , go locations.show route, contains link-to locations.show.devices route. locations.show.devices route contains: {{listing-table model=model.devices type='device' exclude='locationname'}} however, in acceptance tests, can see (by echoing out these attributes in component's javascript) while model , type being updated, exclude set whatever set when component called. now, have checked (via console.log() ) whether component being reused or not, , see both init () , diddestroyel

Class Object Error with Tkinter Game From Python for Kids book http://python-for-kids.com -

i copying game book on learning python called python kids. website book python kids . code shown below. from tkinter import * import random import time class ball: def _init_(self, canvas, color) self.canvas = canvas self.id = canvas.create_oval(10, 10, 25, 25, fill=color) self.canvas.move(self.id, 245, 100) def draw(self): pass tk = tk() tk.title('game') tk.resizable(0,0) tk.wm_attributes('-topmost, 1) canvas = canvas(tk, width=500, height=400, bd=0, highlightthickness=0) canvas.pack() tk.update() ball = ball(canvas, 'red') while 1: tk.update_idletasks() tk.update() time.sleep(0.01) there additional spaces in program in order make easier understand, forgo these spaces in question. error shown below. =============== restart: /users/gg-mac/documents/paddleball.py =============== traceback (most recent call last): file "/users/gg-mac/documents/paddleball.py", line 22, in <module>

php - Woocommerce - Products ship to only a few cities locally -

how go limiting products shipped locally (a range of zip codes)? p.s: other products may ship locally and/or country-wide. a scenario of situation be: user selects product, adds cart, checks out, enters shipping address, system notify him item available shipping locally. i checked settings on woocommerce nothing worked. thanks in advance,

osx - MAC Time Machine : creation of .exclusions.plist -

i used make time machine backup saving, in case if 'lost' file 1 day. day happened , couldn't find single important file in restore : no folder of 'my documents' present. discovered '.exclusions.plist' @ root of backup day, opened , discovered path '/users/ myusername ' present in 'stickyexclusionpaths' array inside .plist. had remove 'tmutil' command know how file constructed because never mentioned link blacklisted backup, please ?

python - how to add two matrices with production rules -

Image
i have 2 matrices, 1 2 x 3 dimensions , other 1 3 x 2. a = [[1, 0, 1], [1, 0, 1]] b = [[1, 0], [1, 0], [1, 0]] i return 2x2 matrix c that's sum of element-wise logical or operation between , b. so result be c = [[3,2] [3,2]] are there packages out there these operations efficiently? large matrices hundreds of thousands of dimensions, looping through elements/vectors slow. this relatively easy return 2x2 matrix d result of addition of element-wise logical and operation between , b. d = np.dot(a,b) accomplish this. i'm wondering if there packages counterparts of np.dot logic or instead. is object oriented approach acceptable ? #!/usr/bin/env python __future__ import absolute_import __future__ import print_function import numpy class pseudobinary(object): def __init__(self,i): self.i = def __mul__(self,rhs): return pseudobinary(self.i or rhs.i) __rmul__ = __mul__ __imul__ = __mul__