Posts

Showing posts from March, 2010

html - How do you make a responsive site without media-queries? -

for life of me, can't quite figure out how template responsive without extensive use of media-queries. https://02dc74ce3e31e56a52ebcc845dca58e87283aabe.googledrive.com/host/0bxbofwq0kd4reut2ywvoymt3wvu/ anyone have ideas? i bought template, , responsiveness kinda broke while applying , author not responding emails. i can't quite figure out how looks elegant on small screens particularly. you can set max-width prevent element wider required on large screens. here fiddle: http://jsfiddle.net/ur3futxp/

objective c - Publishing a private iOS app - Clarifications -

i'm developing ios app going used internally within our organization, , not intend publish app store. i have elementary questions can't seem correct answers despite research. since company owns code, in name should apple id created? once app ready deployed device, in name should purchase developer program? should go corporate purchase asks duns number of corporation? in such cases, should rely on purchase departmentof company make actual purchase? also, how sign app? believe asks email id generate key. can id mine? finally, how add more team members can support or add new features app in absence? how can provide them access build app (code signing). the intention have id test app in real devices. test machines in country 1 , country 2. so, if purchase id country 1, can use same id test devices in country 2 too. there restriction in doing that? we test app in iphone , ipad. there limitation in number of devices added developer id? we have apple id in country...

Open source Android helper library project I can contribute to? -

over past years, own library many helper methods has grown lot , kind of lost vision how sort it. i tried simple folder structure ui/textview , ui/edittext , on. logic have general name root, type name folder, classes inside. in time, grew cannot find many methods , discovered have multiple duplicated methods. can direct me , quality android helper project can see how sorted library? or there public open source project android developers contribute own helper methods aiming creating ultimate helper library? if such thing exist, rather fill gaps own methods , use whole project in applications, continue upgrading own library. try library it's interesting . it's android-bootstrap library , while it's still in beginning , needs improvements necessity of such libraries may make important project , contribution may helpful , community , design of library code easy makes easy understand , can add futures want .

javascript - replacing header text on jQuery click event -

i trying replace text in h3 tag based on jquery click event. however, code not working , if put alert statement inside click event, can see reacting inside function not able execute text() call. header html markup <div class="section margin-top-50"> <h3 id="page_header" class="section-height"><?php echo $this->translate('text_1'); ?></h3> </div> menu html markup (where defining click events) <ul id="mytab" class="nav nav-layout-sidebar nav-stacked"> <li class="active"> <a href="#mood-graph" data-toggle="tab"> <?php echo $this->translate('text_1') ?> </a> </li> <li> <a href="#quick-mood-stats" data-toggle="tab"> <?php echo $this->translate('text_2') ?> </a> </li> <li...

jquery - How do I make a button inactive until requirements are met -

i trying make button have set remain inactive until requirement met, after use button becomes inactive. in code, have money counter count 1 every time click piece of coal on screen. want button inactive until reach amount of money, when it's active want able replace coal ore. finally, when purchase new ore want button become inactive again until earn enough money buy next upgrade. don't know if can use same button multiple purchases want i'm learning use them thoroughly possible! important code: <ul id="one"><strong id="clicks">$<span id="money">0</span></strong></ul> <!-- amount of money earned --> <button type="button" id="upgrade">upgrade gem</button> <!-- button upgrade gem --> <script> /* when coal.png clicked, 1 unit added money counter */ $(function() { $('#coal').click(function() { moneycalc(); }); function moneycalc() { var ...

java.lang.SecurityException when JMX monitor Tomcat from JConsole -

the scenario simple. i'm trying monitor local workstation (mac os 10.9) remote server (ubuntu 12.04) that's running tomcat 7.0.54 spring java app deployed. jvm hotspot 64bit "1.7.0_51" used in both server , workstation. the steps configure tomcat's jmxremotelifecyclelistener fix ports (server.xml) <listener classname="org.apache.catalina.mbeans.jmxremotelifecyclelistener" rmiregistryportplatform="9940" rmiserverportplatform="9941" /> copy catalina-jmx-remote.jar catalina_home/lib open ports sudo iptables -l accept tcp -- anywhere anywhere tcp dpt:9940 accept tcp -- anywhere anywhere tcp dpt:9941 setenv.sh ip=`ifconfig eth0 | grep 'inet '| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`; export catalina_opts="$catalina_opts -dcom.sun.management.local.only=false -dcom.sun.management.jmxremote=true -dc...

scheme - How to delete the first and last elements of a list? -

i'm trying remove both first , last elements of list in racket. there other way of doing instead of: (cdr (reverse (cdr (reverse my-list)))) here's 1 way it, using racket's built-in procedures: (define my-list '(1 2 3 4 5 6 7 8 9 10)) (drop-right (rest my-list) 1) => '(2 3 4 5 6 7 8 9) note: can use cdr instead of rest , rest more idiomatic in racket. more general solution: ; remove `left` number of elements elements left side ; , `right` number of elements right side of list (define (trim lst left right) (drop-right (drop lst left) right)) (trim my-list 1 1) => '(2 3 4 5 6 7 8 9) (trim my-list 2 4) => '(3 4 5 6)

mysql time comparison returning zero records -

Image
i have following query: select * `appointment` `appointment_full_date_from` = '2014-09-20 22:30:00' and table appointment appointment the type of appointment_full_date_from , appointment_full_date_to datetime . when run above query must return visible record table. not doing , returning 0 rows. i tried following query no luck. select * `appointment` `appointment_full_date_from` = str_to_date('2014-09-20 22:30:00','%y-%m-%d %h:%i:%s') what wrong here? can me?

mysql - Default value for foreign key column - InnoDB -

take following sql fiddle: http://sqlfiddle.com/#!2/ae0df/1 set @old_unique_checks=@@unique_checks, unique_checks=0; set @old_foreign_key_checks=@@foreign_key_checks, foreign_key_checks=0; set @old_sql_mode=@@sql_mode, sql_mode='traditional,allow_invalid_dates'; create table if not exists `vatbands` ( `vatbands_id` int unsigned not null auto_increment, `code` enum('a', 'b', 'c', 'd', 'e', 'f') not null, `client_id` int(11) unsigned not null, primary key (`vatbands_id`, `code`, `client_id`), index `vatcode_vatbands` (`code` asc, `client_id` asc)) engine = innodb; create table if not exists `item` ( `item_id` int(11) unsigned not null auto_increment, `client_id` int(11) unsigned not null comment 'customer id', `vatcode` enum('a', 'b', 'c', 'd', 'e', 'f') default 'a', primary key (`item_id`, `client_id`), index `vatcode_item` (`vatcode`...

progress bar - C# mp3 changable progressbar -

i want make mp3 player (i'm using naudio) , want make progressbar witch shows actualy progress of track , user can change it i have 2 problems: progressbar can't modifited user trackbar dont progressbar - can use modifity volume, no track progress please, me a progressbar control show progress. not possible enter kind of value it. cannot use progressbar trackbar. latter 1 designed it. if don't appearance of trackbar, check out internet third-party components. cost money, free. maybe you: owner drawn track bar example (note: didn't downvote...)

mysql - basic sql query problems in hive for using hadoop -

guys facing problem basic command of sql. working on hadoop , hive software learning big data analysis. create table on hadoop file system name of cencus . open hive on terminal , performing simple sql query on , saving on external excel .csv file hive -e 'select * cencus' > '/home/training/hackathon/out.csv it works fine , store table information external file hive -e 'select * sencus education=children' > /home/training/hackathon/out.csv it’s not working show exception there no reduce operator tried lot of time change query to: hive -e 'select * sencus education=''children'' > /home/training/hackathon/out.csv hive -e 'select * sencus education="children"' > /home/training/hackathon/out.csv but nothing working please suggest me need do? i believe following query work. hive -e 'select * sencus education="children";' > /home/training/hackathon/out.csv

java - components in JFrame does not appear when i create a table -

i new in java programming. going well. seems having problem in jframe whenever create jtable called in jscrollpane. components (e.i. buttons, labels etc.) won't appear. when comment table , properties, components appear. may problem? thank help. lot! here method creating table. again. package myphonebookbeta; import java.awt.event.*; import java.sql.*; import java.util.arraylist; import java.util.vector; import java.util.logging.level; import java.util.logging.logger; import javax.swing.*; import javax.swing.table.defaulttablemodel; public class mainform extends jframe implements actionlistener{ //<editor-fold defaultstate="collpased" desc="my components"> jframe f=new jframe(); jpanel p=new jpanel(null); jlabel fnamelbl,lnamelbl,addresslbl,cplbl; jtextfield fname,lname,address,cp; jbutton save,delete,cancel,update; jtable table=null; jscrollpane scrollpane=null; jdesktoppane dp=null; //</editor-fold> //<editor-fold defaultstate=...

Possible reasons for Selenium RemoteWebDriver command timeouts -

we have number of selenium tests running 24/7 , few times day getting random webdriver timeout exception. example: openqa.selenium.webdriverexception: http request remote webdriver server url http://*.*.*.*:4444/wd/hub/session/4957b6a8-c885-4dd7-98ab-373f35619495/url timed out after 120 seconds. ---> system.net.webexception: operation has timed out @ system.net.httpwebrequest.getresponse() @ openqa.selenium.remote.httpcommandexecutor.createresponse(webrequest request) --- end of inner exception stack trace --- @ openqa.selenium.remote.httpcommandexecutor.createresponse(webrequest request) @ openqa.selenium.remote.httpcommandexecutor.execute(command commandtoexecute) @ openqa.selenium.remote.remotewebdriver.execute(string drivercommandtoexecute, dictionary`2 parameters) @ openqa.selenium.remote.remotewebdriver.get_url() ... usually happens in random places (when fetching current url, when clicking element, finding element, etc.) , in different tests. ...

ios - Please explain the following auto layout behavior to me -

Image
i'm trying figure out doing wrong following constraint-based uitableviewcell layout (ios 8). my cell laid out shown in image: there image view on left, label on right, , both should touching cell margins everywhere. image has fixed size (64x64), label's height smaller that. want image's height cause cell expand height correct value (image height + 2 * margin). the problem this: have 3 constraints vertical size, v[image(64)] , reset.bottom == uitableviewcellcontentview.bottommargin , reset.top == uitableviewcellcontentview.topmargin (all defined via storyboard). when display cell, unsatisfiable constraints error. uiview-encapsulated-layout-height constraint interferes constraints, , auto layout breaks image view height constraint. looks should, don't errors @ runtime. if give height constraint priority 999, looks fine, no errors. so understanding is, height constraint broken in both cases @ runtime. but when delete height constraint altogether, image...

javascript - How to play web page mp3 url in HTML5 player? -

i working on page have multiple mp3 links (url) example, <a href="http://www.domain.com/song.mp3" rel="nofollow" target="_blank"> play </a> i play them in player using playlist , download button. there easy way can done! thank all.

Scraping data from multiple html tables within one website in python -

i trying timeseries website python: http://www.boerse-frankfurt.de/en/etfs/db+x+trackers+msci+world+information+technology+trn+index+ucits+etf+lu0540980496/price+turnover+history/historical+data#page=1 i've gotten pretty far, don't know how data , not first 50 rows can see on page. view them online, have click through results @ bottom of table. able specify start , end date in python , corresponding dates , prices in list. here have far: bs4 import beautifulsoup import requests import lxml import re url = 'http://www.boerse-frankfurt.de/en/etfs/db+x+trackers+msci+world+information+technology+trn+index+ucits+etf+lu0540980496/price+turnover+history/historical+data' soup = beautifulsoup(requests.get(url).text) dates = soup.findall('td', class_='column-date') dates = [re.sub('[\\nt\s]','',d.string) d in dates] prices = soup.findall('td', class_='column-price') prices = [re.sub('[\\nt\s]','...

catel - Assert Failure at application start: ReflectionTypeLoad_LoadFailed -

when start application, (mostly first time after compiling), following error displayed. restart of application solves problem times. how can find out root cause? besides error message , stack trace have no other informations cause. visual studio tells me source informations debugging not available. threads info window cann see main thread in catel.reflection.reflectionextensions.gettypesex(). applicationname.vshost.exe - assert failure expression: [mscorlib recursive resource lookup bug] description: infinite recursion during resource lookup within mscorlib. may bug in mscorlib, or potentially in extensibility points such assembly resolve events or cultureinfo names. resource name: reflectiontypeload_loadfailed the complete stack trace available in onedrive . here first few lines: stack trace: @ system.environment.resourcehelper.getresourcestringcode(object userdataln) @ system.runtime.compilerservices.runtimehelpers.executecodewithguaranteedcleanup(trycode code...

What does shift->{o} = $o; do in Perl? -

what line in subroutine mean? shift->{o} = $o; i know shift usualy do, don't understand in context, dash , arrow. inside sub/method, shift is short for shift(@_) a sub call places arguments in @_ . method call same, precedes arguments invocant. if in sub called sub, assigns $o element o of hash referenced first argument. if in sub called method, assigns $o element o of hash referenced invocant. effectively, sets attribute o of object on method called. in process, shift removes reference @_ , though suspect might of no consequence.

javascript - Dimplejs Bug. Line does not show up when series is not null -

i have setup dimplejs.org line chart. should able the clicks colourized blue red (less clicks , line blue, more clicks , line uses gradient blue red). if set series following works fine; tooltip includes x , y points (week , clicks). need tooltip include month. var myseries = mychart.addseries(null, dimple.plot.line); if modify series (as per other examples on dimplejs.org , shown below) include fields in array, line disappears , gradient error in console. var myseries = mychart.addseries(["month","week","clicks"],dimple.plot.line); i have tried tooltip; doesn't help: myseries.gettooltiptext = function (e) { return [ "month: " + e.aggfield[0], "week in year: " + e.aggfield[1], "clicks in week: " + e.aggfield[2] ]; }; i have created fiddle bug/issue. can show me how colourized lines show , without ...

python - how to convert series integer to datetime in pandas -

i want convert integer type date datetime. ex) : 20130601000011( 2013-6-1 00:00: 11 ) i don't know how use pd.to_datetime please advice thanks ps. script below rent_date_raw = pd.series(1, rent['rent_date']) return_date_raw = pd.series(1, rent['return_date']) rent_date = pd.series([pd.to_datetime(date) date in rent_date_raw]) daily_rent_ts = rent_date.resample('d', how='count') monthly_rent_ts = rent_date.resample('m', how='count') pandas seems deal format fine long convert string first: import pandas pd eg_date = 20130601000011 pd.to_datetime(str(eg_date)) out[4]: timestamp('2013-06-01 00:00:11') your data @ moment more of string integer, since doesn't represent single number. different subparts of string reflect different aspects of time.

iphone - Not able to install or update cocoa pods after updating xcode 6 -

Image
i have updated xcode 6. after not able update pod using terminal. when trying pod update "pod update", terminal stuck & not updating it. please check below image. trying update pods. i have solved doing below steps.. uninstall cocoapods $ sudo gem uninstall cocoapods uninstall xcodeproj $ sudo gem uninstall xcodeproj install xcodeproj $ sudo gem install xcodeproj install cocoapods $ sudo gem install cocoapods run pod --version verify worked or not. now cocoa pods updating successfully.

coldfusion - How to deserialize a very large JSON string -

i'm using below api load data our application rec registry as per specification, uses date in yyyy-mm-dd format input. i'm trying deserialize returned json string due large amount of data; i'm getting connection failure error. is there better way (probably asynchronous) same? tried searching of solutions involve .net . code far: <cfhttp url="https://rec-registry.gov.au/rec-registry/app/api/public-register/certificate-actions" result ="recregistry_json" method="get" getasbinary="never"> <cfhttpparam name="date" value="#dateformat(dateadd("d",-3, now()),"yyyy-mm-dd")#" type="url"> </cfhttp> <cfset recjson = deserializejson(recregistry_json.filecontent)> <cfdump var="#recjson#"> edit 1 : based on adam cameron's comment, issue cfdump not able dump huge chunks of data. deserialisation works fine 20 mb wort...

Enabling button on any value change in JSF form -

i have multiple fields including text,checkbok box, drop-down etc in jsf form, showing values db.i submit button disabled default , clickable if user made changes of fields in form. please !! not tested, use : $(document).ready(function() { $('#formid input[type="submit"]').attr('disabled','disabled'); $('#formid').change(function(){ $('#formid input[type="submit"]').removeattr('disabled'); }); }); if don't use jquery functions in view (any primefaces ajax buttons example), might need add : <h:outputscript library="primefaces" name="jquery/jquery.js" />

javascript - CKEditor append child error -

with project on, have been asked move ckeditor 3 4. works fine except custom plugin wrote. argument 1 of node.appendchild not object. the code on place, , bit of mess. here plugin, think causing error. /* copyright (c) 2003-2011, cksource - frederico knabben. rights reserved. licensing, see license.html or http://ckeditor.com/license */ /** * @fileoverview "limereplacementfields" plugin. * */ (function() { var limereplacementfieldsreplaceregex = /(\{[a-z]+[^\{\}]+[a-z0-9]+\})/g; ckeditor.plugins.add( 'limereplacementfields', { requires : [ 'dialog' ], lang : [ 'en' ], init : function( editor ) { var lang = editor.lang.limereplacementfields; editor.addcommand( 'createlimereplacementfields', new ckeditor.dialogcommand( 'createlimereplacementfields' ) ); editor.addcommand( 'editlimereplacementfields', new ckeditor.dialogcommand( ...

Replacing an entire string with one single letter in R -

i have data set in need rename every data "kas" every instance of kasaragod in column. need replace entire thing in column "kas" if instance found. p o, pin: 671543,kasaragod kas what command should use? sample data: g05 g06 g07 g08 g09 g10 address_2 a+ a+ a+ a+ a+ kumbadaje p o, pin: 671551, kasaragod b b b+ mallam p o, pin: 671542, kasaragod b+ b b+ a+ c+ b+ kumbadaje p o, pin: 671551, kasaragod b+ b+ b b+ a+ movvar p o, pin: 671543, kasaragod b b b b+ a+ a+ movvar p o, pin: 671543, kasaragod a+ a+ a+ a+ a+ a+ movvar p o, pin: 671543, kasaragod b+ b+ b b+ yethadka p o, pin: 671551, kasaragod c c c c c movvar p o, pin: 671543, kasaragod a+ a+ a+ a+ a+ a+ movvar p o, pin: 671543, kasaragod my first thought gsub. if data frame called edu, try edu$address_2 <- gsub(".*kasaragod.*", "kas", edu$address_2) this give g05 g06 g07 g08 g09 g10 addr...

html - Change 2 strings on load with javascript -

i try replace 2 parts of string in lot of pages on page load. in case, replace: <iframe width="890" height="514" src="https://www.youtube.com/embed/ with string and ?enablejsapi=1" frameborder="0" allowfullscreen="allowfullscreen"></iframe> with one. tried use <script type="text/javascript"> window.onload = clear; function clear() { document.body.innerhtml = document.body.innerhtml.replace(/xxx/g, 'yyy'); } </script> but did not work. it needs done on page load. idea? thank you! edit: what try do, split youtube embed in div. part before unique youtube id needs replaced , part after id needs replaced. complete link like: <iframe width="890" height="514" src="https://www.youtube.com/embed/xxxxxxxx?enablejsapi=1" frameborder="0" allowfullscreen="allowfullscreen"></iframe> the part before xxxxxxxx , p...

jssor - Where is information about options for caption transitions -

is there documentation describes various attributes component utilizes? in div, see u=caption, assume u attribute describing kind of element is. there other attributes, such d=-750, t=l, b=500, etc. what these attributes, , how use them? <div id="slider1_container" style="position: relative; width: 600px; height: 300px; overflow: hidden;"> <!-- slides container --> <div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 600px; height: 300px; overflow: hidden;"> <div> <img u="image" src="/content/img_0381.jpg" /> <div u=caption t="l" d=-750 b=500 style="position:absolute; left:20px; top: 300px; width:130px; height:30px;"> hello world </div> the 'u' (or 'data-u') attribute describes usage of element. define html...

Get element using PHP or Javascript -

i'm trying value of element page http://mhs.mamkschools.org on right sidebar shows day ("day 4"), i've tried using domdocument, regex , few other options. wondering if of able me out this. thanks. i'm assuming have html. <?php $htmlstring = <<<eof <div class="upcomingevent"> <div class="upcomingeventinner"> <div class="uecontent"> <div id="ctl00_lm_wp411648411_ctl00_template_upcomingevents_ctrl0_events_ctrl0_ctl00_titleplaceholder" class="uetitle"> <span>day 4</span></div> <div class="clear-both"></div> </div> </div> </div> </div> <div class="upcomingeventday"> <div class="uedate"><span class="uedatebullet color-pc"></span>tuesday, september 23</div> <div class="upcomin...

x509certificate - Spring Security SAML trusted certificate entries are not password-protected -

i'm integrating spring-saml2-sample app own application. service provider connects shibboleth idp. i'm testing sp private certificate provided in samlkeystore.jks came spring security saml application. registered idp signing public key in keystore using command: keytool -importcert -alias idpsignkey -keypass passwords -file key.cer -keystore samlkeystore.jks i'm able run app , login idp. can see in log public certificate send me in saml message corresponds 1 have in idp metadata , registered in keystore. app breaks while getting idp credential jkskeymanager. java.lang.unsupportedoperationexception: trusted certificate entries not password-protected java.security.keystorespi.enginegetentry(unknown source) java.security.keystore.getentry(unknown source) org.opensaml.xml.security.credential.keystorecredentialresolver.resolvefromsource(keystorecredentialresolver.java:132) org.opensaml.xml.security.credential.abstractcriteriafilteringcredentialresolver.re...

ios - today extension, table cells not showing -

i have been writing today extension app, , have loading main apps core data database. seems working fine, can see core data information being loaded, i'm not getting cells displayed the code have override func numberofsectionsintableview(tableview: uitableview) -> int { return self.fetchedresultscontroller.sections!.count } override func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { let sectioninfo = self.fetchedresultscontroller.sections![section] nsfetchedresultssectioninfo return sectioninfo.numberofobjects } var fetchedresultscontroller: nsfetchedresultscontroller { if _fetchedresultscontroller != nil { return _fetchedresultscontroller! } var instance = singleton.sharedinstance let fetchrequest = nsfetchrequest() // edit entity name appropriate. let entity = nsentitydescription.entityforname("medicine", inmanagedobjectcontext: instance.moc) fetchre...

python - Why might a session not be current? -

i have unit test defined so. setup works correctly. config dictionary location of mysql executable , name of database. import unittest #mercury datainterface import sqldatasources candc import blankslate candc import configuration #under test candc import addtask #this temporary measure until more elegant configuration implemented configpath = '/somewhere/in/my/filesystem' class addtasktest(unittest.testcase): ''' test adding task ''' def setup(self): ''' blank out database ''' config = configuration.config(configpath) blankslate.wipe(config) def test_addandretreive(self): ''' add , retrieve task ''' config = configuration.config(configpath) source = sqldatasources.source(config.sqlcredentials()) #of type sqlalchemy.orm.session.session session = source.sqlsession() #insert test tasks addtask.insert('tests/candc/test_task...

ruby on rails - How to ignore routing error with wrong verb -

i have few post actions. there stupid crawlers trying ping actions, resulting in "no route matches [get]" errors. there of them, , of them purely noise. how can make kind of error messages ignored. i used use exception_notification gem, , use rollbar gem. amount of these kind of trash error message floods error monitoring (either lots of messages, or error api calls).

java - Android updating Activity when onBackPressed is called on another Activity -

as title suggests, aim update variables on 1 activity " mainactivity " when activity " addactivity " being pressed. @ moment, way can update variables on mainactivity when create new instance of it, don't want do. want update of variables happen on mainactivity instantiated. snippets of code below: public class addactivity extends mainactivity { .... @override public void onbackpressed() { super.onbackpressed(); updatemain(); } } public class mainactivity extends activity { .... // gets executed when activity gets created @override protected void onstart() { super.onstart(); log.d("tag", "main onstart"); updatemain(); } protected void updatemain() { dbadapter dba = new dbadapter(this); dba.open(); .... double cost = dba.getcost(); string coststring = string.valueof(cost); textview.settext(coststri...

javascript - How to make first radio button selected by default in a list built with a for in loop using twig? -

i'm using twig make list of radio buttons database values. it's like: {% usermembershiptype in usermembershiptypes %} <div class="ms_type noline"> <p>{{ usermembershiptype.description}}</p> <label class="ms_price ms_odd">${{ usermembershiptype.price }}<span>/year</span><input name="membership-type" type="radio" value="{{ usermembershiptype.id }}"/></label> <div class="clearfix"></div> </div> {% endfor %} i want first radio button selected default when using in loop, i'm not sure how refer first radio button. any advices? javascript , jquery solutions welcome. you can use loop.index , if condition like {% usermembershiptype in usermembershiptypes %} <div class="ms_type noline"> <p>{{ usermembershiptype.description}}</p> <label class="ms_price...

python - XLRDError: Unsupported format, or corrupt file: Expected BOF record; -

i trying open workbook through xlrd. import xlrd workbook=xlrd.open_workbook("d:\book1.xlsx") but throwing error below: traceback (most recent call last): file "c:\users\testuser\documents\netbeansprojects\newpythonproject\src\newpythonproject.py", line 18, i`enter code here`n <module> workbook=xlrd.open_workbook("d:\book1.xlsx") file "d:\xlrd-0.7.1\xlrd\__init__.py", line 429, in open_workbook biff_version = bk.getbof(xl_workbook_globals) file "d:\xlrd-0.7.1\xlrd\__init__.py", line 1545, in getbof bof_error('expected bof record; found %r' % self.mem[savpos:savpos+8]) file "d:\xlrd-0.7.1\xlrd\__init__.py", line 1539, in bof_error raise xlrderror('unsupported format, or corrupt file: ' + msg) xlrd.biffh.xlrderror: unsupported format, or corrupt file: expected bof record; found 'pk\x03\x04\x14\x00\x06\x00' i running in netbeans python plugin. if version of xlrd issue need link dow...

android - Selected SMS by keyword to Listview -

how select sms keyword body listview? current progress: sms shown in listview, sms displayed. want display selected sms keyword. code. public list<string> getsms() { list<string> list = new arraylist<string>(); uri urismsuri = uri.parse("content://sms/inbox"); cursor cursor = null; try { cursor = getcontentresolver().query(urismsuri, null, null, null, null); } catch (exception e) { e.printstacktrace(); } try { (boolean hasdata = cursor.movetofirst(); hasdata; hasdata = cursor .movetonext()) { string body = cursor.getstring(cursor.getcolumnindex("body")); list.add(body); } } catch (exception e) { e.printstacktrace(); } return list; } if add body content listview, why not compare keyword before adding? string keyword = "hello" try { (boolean hasdata = cursor.movetofirst(); hasdata; h...

java - Junit: MethodNotFoundException with PowerMock -

while running dbunit based junit test case, following exception: java.lang.runtimeexception: invoking beforetestmethod method on powermock test listener org.powermock.api.extension.listener.annotationenabler@2a5f1994 failed. @ org.powermock.tests.utils.impl.powermocktestnotifierimpl.notifybeforetestmethod(powermocktestnotifierimpl.java:92) @ org.powermock.modules.junit4.internal.impl.powermockjunit44runnerdelegateimpl$powermockjunit44methodrunner.executetest(powermockjunit44runnerdelegateimpl.java:292) @ org.powermock.modules.junit4.internal.impl.powermockjunit44runnerdelegateimpl$powermockjunit44methodrunner.runbeforesthentestthenafters(powermockjunit44runnerdelegateimpl.java:282) @ org.junit.internal.runners.methodroadie.runtest(methodroadie.java:84) @ org.junit.internal.runners.methodroadie.run(methodroadie.java:49) @ org.powermock.modules.junit4.internal.impl.powermockjunit44runnerdelegateimpl.invoketestmethod(powermockjunit44runnerdelegateimpl.java:20...

php - Select each first record with id in another table's result -

i have 2 tables, users(id, username) , posts(id, user_id, content) . want list summary of them which, want list users , first post of each user. how can realize in 1 query? i tried like. query select users.*, posts.content users, posts posts.user_id=t_users.id but return posts each user (i cannot add limit 1 @ tail of course returns 1 user). some sample records: users table: id username 1 test1 2 test2 posts table: id user_id content 1 1 test1's content. 2 1 test1's content. 3 2 test2's content. and want result: users.id users.username posts.content 1 test1 test1's content. 2 test2 test2's content. here 1 approach latest record per user assume latest record considered minimum post id select u.*, p.content users u join posts p on p.user_id=u.id join (select user_id ,min(id) id posts group user_id ) p1 on (p.id = p1.id , p.user_id = p1....

javascript - Input type date ,time not working on other browsers except Chrome -

input type date or time not working firefox or other browsers except crome. there way use input type date or time in other browsers. it's known issue fire fox check out html5 input types, many have yet implemented in both firefox if browser not support html5 features want use, try modernizr . uses javascript enhance support. it's documentation has information input types .

android - Want to do Two diffrent activity in same screen -

i want 2 different activity in same screen . know fragment when use fragment show different ui 10 inch table , different 4.6 inch mobile. want screen open dividing screen in 2 equal part in landscape mode , can able different activity in both equally divided part of screen. searched lot didn't find appropriate solution question. actually want develop game in 1 half of screen user , half computer(android os). dividing in equal parts can achieved weight attribute. i assuming versed fragments telling xml part screen divided 2 equal fragments. <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <fragment android:name="com.example.android.fragments.fragment1" android:id="@+id/headlines_fragment" android:layout_weight="1" android:layout...

css3 - CSS circle mask -

i looking create dark mask @ bottom of circle contained in main circle. can using css masks? please see fiddle <div id="profile-pic-wrap"> <div id="profile-pic"> <div class="profile-btn-bg"> <a href="#" class="profile-pic-btn">change profile</a> </div> </div> </div> thanks you can use overflow:hidden; : demo changes css : added overflow:hidden; , text-align:center #profile-pic #profile-pic { position: absolute; z-index: 999; width: 200px; height: 200px; left: 33px; background: #fff; border: 3px solid #fff; border-radius: 100px; -webkit-border-radius: 100px; -moz-border-radius: 100px; top: 0px; position: relative; background:red; overflow:hidden; text-align:center; } .profile-btn-bg{ position: absolute; background-color: black; width: 100%; height: 30%; bottom: 0px; } a.profile-pic-btn{...

sql server - SQL Query where a specific column should have two specific values but have just one -

sorry cryptic title, didn't find better question i have table lets these data: table article id articlenumber type 1 10 1 2 10 3 3 20 1 4 30 1 5 30 3 i'm looking 3. row no type 3 article exists type 1 article exists. i think have easy sql query can't find solution... to articlenumbers exists row type = 1 there no row type = 3, use this: select * article a.`type` = 1 , not exists ( select * article a2 a2.`type` = 3 , a2.articlenumber = a.articlenumber )

postgresql - Implement Tapatalk image upload in Perl -

i writing tapatalk plugin using perl. have gone through tapatalk documentation upload images tapatalk app https://tapatalk.com/api/api_section.php?id=8#upload.php as per documentation, have upload.cgi @ root of plugin directory called when image upload tried tapatalk app. have method name, forumid, attachment image name in upload.cgi. but confuse how handle display uploaded image in tapatalk app after successful upload. how input parameters of upload.cgi handled. how upload details posted upload.cgi i have posted form details below my $req = post '$upload_url', content_type => 'form-data', content => [ method_name => 'upload_attach', forum_id => $forumid, "attachment[]" => [ undef, $filename, 'content-type' => 'image/jpeg', ...

meteor - User plans / limit with payment in MeteorJS -

has done user plans / user limits saas payment in meteorjs? did use specify package? did try doing alanning:roles ? you can set plans/user limits not yet payment :-)

task parallel library - MVP Winforms and TPL -

my application synchronous, using mvp. want introduce tpl pull report database takes number of seconds generate. have investigated threads , background workers , feel tasks way go. where create tasks? in presenter? or create wrapper class tasks , use in presenter? use ioc inject presenter? i thinking of unit testing too, how easy test method in presenter creates asyc calls?

how to call array filter within ractivejs template -

so don't want use data functions (let's want final user interact templates , not hardcode javascript.) if had array n elements how can filter can m elements within ractive template ? right have code >> http://jsfiddle.net/t168vymw/4/ not working correctly. requirements: cannot use function filter, data: {filtersomething: function(){...} } instead, let user play complex array function convertions template. ractive yet supporting ? ractive doesn't support involves function keyword inside expressions, there 3 ways this: data functions, method calls (calling methods of ractive instance inside template), filtering data directly in template. you said want logic in template leaves option #3. example, if wanted display numbers list, this: {{ #a }} {{ #!(this % 2) }} {{ }} {{/}} {{ /a }} however, considered anti-pattern. it's better idea allow user write custom js or provide them prepared functions can use in template. ...

Ruby on Rails routes translation using route_translator gem -

i'm using route_translator gem , when run rake routes seems working fine. part of output: travels_en /en/travels(.:format) travels#index {:locale=>"en"} travels_pt_br /viagens(.:format) travels#index {:locale=>"pt-br"} i can access pt-br routes application links take me english route, i'm using rails methods. have change route methods new_travel_path , link_to specific? one thing need make sure pt_br yml file has foreign routes want appear. example in pt_br yml file have following code match example: routes: travels: viagens when click en should see /en/travels before. when click pt_br should see /pt_br/viagens . another thing check make sure in config/routes.rb have routes being translated within following statement. localized whatever routes should appear here end this have done 1 of sites in english , french.