Posts

javascript - Which is correct approach & or & in Wordpress urls -

as figured out, gives me problems on landing page ($tab get's variables stack ['amp;tab'] instead of ['tab'] ): wp_redirect("admin.php?page=booking-manager&amp;tab=customers"); if debug with: $tab = isset($_get['tab']) ? $_get['tab'] : ""; echo nl2br(print_r($_request, true)); die("tab:$tab"); i get: array ( [page] => booking-manager [amp;tab] => customers ) tab: so had use without ampersanding make if work: wp_redirect("admin.php?page=booking-manager&tab=customers"); while onclick , form action attributes, & ampersanding working: onclick: onclick="window.location.href='<?php print(admin_url('admin.php?page=add-discount&amp;discount_type=1&amp;discount_id=0')); ?>'" form action: <form action="<?php echo admin_url('admin.php?page=add-customer&noheader=true'); ?>" method="post" id="f...

OS X: Sorting NSTableView binding to NSArrayController -

Image
i have nstableview bind nsarraycontroller. i'm sorting nstableview , works fine when click on row of nstableview different value nsarraycontroller not been sorted. here how i'm sorting nstableview: nssortdescriptor *sd = [nssortdescriptor sortdescriptorwithkey:@"names" ascending:yes]; [self.names setsortdescriptors:[nsarray arraywithobject:sd]]; for example when click on name1 value of name2. need match values of nstableview nsarraycontroller. of knows i'm doing wrong? or how can sort both nstableview , nsarraycontroller ? i'll appreciate help when click on name1 value of name2 how value? i suspect you're looking in wrong place. first, should bind table view's selectionindexes binding array controller's selectionindexes property. likewise, should bind table view's sortdescriptors binding array controller's sortdescriptors property. it's not clear self.names refers in code. table view or array con...

google maps - Cannot resolve symbol 'mapView' on android studio -

after tons of tries couldn't found how solve this. android won't resolve symbol 'mapview' on: mmapview = (mapview) v.findviewbyid(r.id.mapview); what i'm trying google maps work on emulator. know code working on pc, guess here there's else.. (a system issue or google maps api problem) here's code. can help? thank you.. package com.example.matant.gpsportclient.controllers; import android.app.fragment; import android.os.bundle; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import com.example.matant.gpsportclient.asyncresponse; import com.example.matant.gpsportclient.r; import com.google.android.gms.maps.cameraupdatefactory; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.mapview; import com.google.android.gms.maps.mapsinitializer; import com.google.android.gms.maps.model.bitmapdescriptorfactory; import com.google.android.gms.maps.model.ca...

Python 2.7: Remove subdomains from list -

i have list 1,300,000 items. example, ['.a', '.b.a', '.c.b', '.f.c.b']. i'd remove subdomains (e.g. '.b.a' , '.f.c.b' in list above). i'm newbie. trying learn speed. following attempts, seem slow. suggestions: # create separate lists, perhaps faster a1 = [] b2 = [] c3 = [] d4 = [] e5 = [] f6 = [] in dupesgone: j = i.count('.') if j == 1: a1.append(i) elif j == 2: b2.append(i) elif j == 3: c3.append(i) elif j == 4: d4.append(i) elif j == 5: e5.append(i) else: f6.append(i) in a1: la = -len(a) b in b2: if == b[la:]: b2.remove(b) c in c3: if == c[la:]: c3.remove(c) d in d4: if == d[la:]: d4.remove(d) --snip-- # how this, faster [b2.remove(b) b in b2 in a1 if == b[-len(a):]] [c3.remove(c) c in c3 in a1 if == c[-len(a):]] [d4.remove(d) d in d4 in a1 if == d[-...

c# - WPF InkCanvas: how to disable antialiasing -

i'm using inkcanvas in project , noticed whenever draw something, stroke sharp, , once release mouse button becomes blurry. is there way can keep stroke identical looks i'm drawing it? right i'm going through array image , remove pixel doesn't match color.red (i.e., argb: 255,255,0,0)... , i'm sure there's smarter way this! thanks in advance. ok. found answer! sources: https://social.msdn.microsoft.com/forums/vstudio/en-us/d95c6b91-2a68-455b-b9d4-021bd5c96029/how-to-disable-smoothing-for-stroke-?forum=wpf rendering sharp lines in wpf i tried add renderoptions.edgemode="aliased" directly xaml (the property doesn't show in properties window, when selecting inkcanvas) , works. this: <inkcanvas x:name="myinkcanvas" moveenabled="false" ...> to: <inkcanvas x:name="myinkcanvas" moveenabled="false" renderoptions.edgemode = "aliased" ...> on mouseup, stroke st...

c# - How do I fix my platformer collision detection? -

i'm working on game allows 2d sprite jump on platform when lands on platform, 2d sprite not on top of platform, exceeding or same position of platform. //here code: texture2d jumper; texture2d tile; vector2 position, velocity; rectangle top; rectangle tile_rectangle; rectangle jumper_rectangle; keyboardstate ks; bool jump; //here load content: protected override void loadcontent() { jump = true; position.x = 10; position.y = 10; jumper = content.load<texture2d>("character"); tile = content.load<texture2d>("tile"); tile_rectangle = new rectangle(300, 350, tile.width, tile.height); top = new rectangle(tile_rectangle.x, tile_rectangle.y - 16, tile_rectangle.width, 10); } //here update: protected override void update(gametime gametime) { ks = keyboard.getstate(); position += velocity; float = 1; if (ks.iskeydown(keys.up) && jump == false) { position.y -= 10f; velocity...

html - Aligning divs underneath each other -

Image
i have html: <div id="container" class="container"> <div id="menu-top"> <div class="top-menu"> <div class="top-menu-buttons"> <button class="button button-icon ion-minus-circled"></button> <span>{{amount}}</span> <button class="button button-icon ion-plus-circled"></button> </div> </div> </div> <div id="classic" class="classic"> <div id="classic-img" class="classic-img"> <img ng-src="{{image.filtered}}" /> </div> </div> <div id="menu-bottom"> <div class="bottom-menu"> <div class="bottom-menu-buttons"> <button class="button butto...