Posts

php - Get category ID in Magento Footer -

i want current category id in magento footer area can create condition things not shown in specific category. example want do: if current category 111 not show social icons i tried following code: <?php$current_id= mage::getmodel('catalog/layer')->getcurrentcategory()->getid();echo $current_id;?> problem above code echo random id , doesnt change go thru different categories. please help. thank you. when don’t have access $this, can use magento registry: $category_id = mage::registry('current_category')->getid(); or get variable set on block xml $this->getlayout()->getblock('product_list')->getcategoryid()

sql - MySQL Workbench scheduled backup utility -

[i posted query below database admin stackexchange site put on hold due being off-topic, came wee surprise. hope it's not ot stackoverflow. ] my (medium-sized) organisation uses excellent mysql workbench 6.1 community db management. workbench used have scheduled backup tool built in, iirc, no longer - have buy enterprise edition this. so i've quick question: cheap/open source utilities available plugin in workbench configure , run scheduled backups of selected or db? 'backup', mean nightly sql dump of n dbs. there thread at automatic backup mysql workbench references heavy-duty tools. another thread on here refers outdated workbench version. we can use batch file (it's windoze server) schedule backups, futureproofing , sake of successor(s) nice have easy-to-use gui tool. recommendations? there's no free tool or plugin mysql workbench schedule backups. mysql enterprise backup (in short meb) can that, including management within mysql workben...

Swift declare that AnyClass object implements protocol -

i writing framework creating plugins os x application. these plugins loaded nsbundle s, , bundles' principalclass es used run plugin code. however, can't figure out how declare principalclass object conforms protocol. let bundles = cfbundlecreatebundlesfromdirectory(kcfallocatordefault, nsurl(fileurlwithpath: bundledirectory), "bundle") nsarray bundle in bundles { let bundleclass = bundle.principalclass!! if (bundleclass.conformstoprotocol(myprotocol.self)) { //produces compiler error: //"cannot downcast 'anyclass' non-@objc protocol type 'myprotocol'" let loadedclass = bundleclass myprotocol } } what proper syntax declaring conforms protocol? (also, protocol declared @objc i'm not sure why says "non-@objc" protocol.) try: bundleclass myprotocol.protocol . docs here . btw, code can simplified let bundles = cfbundlecreatebundlesfromdirectory(kcfallocatordefault, nsu...

python - Firefox Build does not work with Selenium -

for research, did source code modifications in firefox , build myself. in order automate testing, opted use selenium unfortunately, newly built firefox seem not support selenium. i did following: from selenium import webdriver selenium.webdriver.firefox.firefox_binary import firefoxbinary binary = firefoxbinary("/path/to/firefox/binary") d = webdriver.firefox(firefox_binary=binary) d.get("http://www.google.de") the firefox open , responsive (i can enter website in search bar). after while, python script crashes following error message: traceback (most recent call last): file "firefox.py", line 7, in <module> d = webdriver.firefox(firefox_binary=binary) file "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/firefox/webdriver.py", line 59, in __init__ self.binary, timeout), file "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__ ...

amazon s3 - FineUploader - Error on multi-part upload to S3 -

i using fineuploader upload s3. have working including deletes. however, when upload larger files broken multi-part uploads, following error in console (debugging turned on): specific problem detected initiating multipart upload request 0: 'the request signature calculated not match signature provided. check key , signing method.'. can point me in right direction should check settings, or additional info might need? since haven't included specific setup, code, or failing request, best guess server isn't returning proper signature response uploads made s3 rest api (which used larger files). you'll need review procedure generating response type of signature request. here's relevant section fine uploader's s3 documentation : fine uploader s3 uses amazon s3’s rest api initiate, upload, complete, , abort multipart uploads. rest api handles authentication signing canonically formatted headers. signing need implement server-side. ...

javascript - ruby on rails: leaflet-rails not loading -

using ror 4.1.4 i trying use leaflet-rails gem . followed steps outlined in github page, when try load map, see referenceerror: l not defined in browser console. means helper gem being loaded , executed can't find leaflet.js file. however, head section of page shows /assets/leaflet.js being referenced , there. when @ generated code: <div id="map"></div> <script> var map = l.map('map') map.setview([-54.0, 6.08], 16) l.tilelayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '&copy; <a href="http://osm.org/copyright">openstreetmap</a> contributors', maxzoom: 18, subdomains: '', }).addto(map) </script> </div> <script src="/assets/jquery.js?body=1" data-turbolinks-track="true"></script> <!-- other scripts loaded --> <script src="/assets/exif.js?body...

.net - Can we type strings with use of hex codes in c# like we type integers like that int a = 0x0000cd54;? -

i think kind of unusual thing ask, need this. well, know can this: string str = "45 ac 1b 5c"; and convert meaningful, if don't want bother conversion , want set string somehow that: "0x00000045 0x000000ac 0x0000001b 0x0000005c" , automatically becomes common characters? is there way? string str = "\x45 \xac \x1b \5c" http://msdn.microsoft.com/en-us/library/aa691090%28v=vs.71%29.aspx