Posts

Showing posts from February, 2012

android - Hide ticker text in notification using Notification.Builder -

i'm trying display ongoing notification without initial ticker text display. able working older style notification setting ticker text null in constructor: mnotification = new notification(r.drawable.ic_stat_playing, null, system.currenttimemillis()); however, noticed instantiating notification way deprecated, , use of notification.builder recommended instead. however, cannot notification display without ticker text, when set ticker text null: notification.builder builder = new notification.builder(this); charsequence contenttext = "contenttext here"; intent launchintent = new intent(this, mainactivity.class); // pendingintent launch our activity if user selects // notification pendingintent contentintent = pendingintent.getactivity(this, -1, launchintent, pendingintent.flag_update_current); builder.setcontentintent(contentintent) .setsmallicon(r.drawable.ic_stat_playing) .setlargeicon(null) .setticker(null) .setonlyalertonce(...

f# - Translate Haskell parsec to FParsec -

how translate haskell code: import text.parsercombinators.parsec((<|>), unexpected, lookahead, noneof, char) import control.monad(when) data bracketelement = bechar char | bechars string | becoll string | beequiv string | beclass string p_set_elem_char = c <- noneof "]" when (c == '-') $ atend <- (lookahead (char ']') >> return true) <|> (return false) when (not atend) (unexpected "a dash in wrong place in bracket") return (bechar c) to fparsec ? preferable way without monadic syntax provide performance. thanks in advance, alexander. sorry little misleading. corrected problem make haskell code compilable: import text.parsercombinators.parsec((<|>), (<?>), unexpected, lookahead, noneof, char) import control.monad(when) import data.functor.identity import qualified text.parsec.prim pr -- | bracketelement internal module data bracketelement = bechar char | bechars string | becoll string...

wix3.5 - WIX where can i find WixUi_en-us file? -

i have installed wix 3.5 , want customize dialogs, can find wixui_en-us file? you need download wix 3.5 source from here . unzip files. want uiextension folder, located in directory structured src\ext\uiextension\wixlib edit: @ second glance, don't see wix 3.5 source posted there. maybe else knows. if need strings file though, can downloading source code 1 of latest wix 3.6 releases . not sure if has changed or not far specific file goes.

Header files for x86 SIMD intrinsics -

which header files provide intrinsics different x86 simd instruction set extensions (mmx, sse, avx, ...)? seems impossible find such list online. correct me if i'm wrong. <mmintrin.h> mmx <xmmintrin.h> sse <emmintrin.h> sse2 <pmmintrin.h> sse3 <tmmintrin.h> ssse3 <smmintrin.h> sse4.1 <nmmintrin.h> sse4.2 <ammintrin.h> sse4a <wmmintrin.h> aes <immintrin.h> avx <zmmintrin.h> avx512

calling a c# wcf webservice from c# client -

i have c# wcf web service , c# client makes calls web service working fine , have scenario below unable figure out how it. here case, have 2 methods in c# client 1st method make more time , client doesn't know going on response wcf web service take long time, implemented 2nd method gives status of 1st method call(saying first method has total of 10 tasks , performing 1 or 2 or 3 etc). don't have idea how call goes 2nd method first method not yet completed , both methods have in same client. can 1 please this. if have understand correctly... need implement asynchronous invocation . default in wcf calls synchronous. what have synchronous invocation.: method1 (client) invokes method2 (server) have tasks done. method1 waits long time until method2 finishes method1 receives true (or whatever) method 2 method 1can continue doing things. what need is: method1 (client) calls method2 (server) method2 2.1 validate request correctly formed 2.2 creates thr...

asp.net mvc 3 - Import Cardinality Mismatch Exception -

i have main app , plugin. main app exporting ihost object , plugin importing ihost object. ran mefx , recognizes both of those. when /causes on plugin gives me importcardinalitymismatchexception. container sees plugin, when call me.container.getexports(of icontroller)() doesn't return anything. my controller looks this: class controller implements icontroller ' ... <import()> public property host lazy(of ihost) ' ... end class i had <importmany()> in plugin. variable importing needed make ienumerable(of lazy(of ihost)) or use lazy(of ihost) if want <import()>

entity framework - Linq woes - A CollectionType is required -

why doesn't linq query work? i suspect may have lazy loading. seems work in linqpad. public ilist<paymentdto> getdocumentpayments(int documentid, bool? allowrepeatpayments, byte[] paymentstatuses, int[] paymentmethods) { using (var ctx = objectcontextmanager<mydatacontext>.getmanager("mydatacontext")) { var payments = new list<paymentdto>(); var ps = new list<byte>(); if (paymentstatuses != null) { ps = paymentstatuses.tolist(); } var pm = new list<int>(); if (paymentmethods != null) { pm = paymentmethods.tolist(); } iqueryable<payment> data = payment in ctx.objectcontext.documents.oftype<payment>() ps.contains(payment.status) && pm.contains(payment....

asp.net mvc errorhandler not showing custom error page -

i trying follow examples in this link , this one instead of showing error page http 500 internal server error. have <customerrors mode="on" /> set in webconfig. have tried applying [handleerror] filter controller class. tried without well. error.aspx present in /views/shared/ couldn't case of no file found. i threw dividebyzero exception in controller's action method. want follow example can specify separate error page actions need them. i using aspx view engine in blank project created. should not reason right?. using master page this. missing? thanks edit-added code i added code new project , made web.config entry <customerrors mode="on" /> [handleerror] public class homecontroller : controller { // // get: /home/ [handleerror] public actionresult index() { throw new dividebyzeroexception(); return view(); } } it didnt work! commented d...

page lifecycle - Is there an after Page_Load event in ASP.net -

Image
is there event triggered after all page_load events have completed? how can have more 1 page_load ? when have user controls. before page can render, need page (and embedded controls) have initialized completing page_load events. the problem, of course, if put code in page's page_load handler: mypage.aspx --> page_load ---> dosomethingwithusercontrol() usercontrol1.ascx --> page_load ---> initialize ourselves viewstate has been restored then begin access usercontrol1 control before ready. i need way run code after page_load events have fired, before postback events (e.g. click events) have fired: mypage.aspx --> page_load usercontrol1.ascx --> page_load ---> initialize ourselves viewstate has been restored mypage.aspx --> page_afterload ---> dosomethingwithusercontrol() looking @ page lifecycle in msdn looks there no way raise event after page_loads have been complet...

javascript - Auto center the marker on google maps -

i have marker on google maps on website. want marker @ center of map whether zoom in or zoom out. in sense, lets marker @ boston , zoom level of map in such way can see whole massachusetts state, no matter @ part of state zoom into, boston should @ center of map newer zoomed level, same thing should happen when zoom out. from google docs google.maps.event.addlistener(map, 'center_changed', function() { // 3 seconds after center of map has changed, pan // marker. window.settimeout(function() { map.panto(marker.getposition()); }, 3000); }); you can use center map on event map.setcenter(marker.getposition());

android - Can not change the text using SharedPreferences -

i made small project try change name edit text using share preference.here code sharepreferenceownactivity.java public class sharepreferenceownactivity extends activity { button b1; textview t1; /** called when activity first created. */@override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); b1 = (button) findviewbyid(r.id.b1); t1 = (textview) findviewbyid(r.id.t1); loadpreferences(); b1.setonclicklistener(new onclicklistener() { public void onclick(view v) { toast.maketext(getapplicationcontext(), "settings", toast.length_short).show(); intent intent = new intent().setclass(sharepreferenceownactivity.this, sharepreferenceactivity.class); startactivity(intent); } }); } private void loadpreferences() { sharedpreferences sharedpr...

objective c - How to create a Song Visualization in WaveFrom in MPMusicPlayer Controller -

hai folks last couple of days iam working on code create song visualization in wavefrom,,,.this code got drawing waveform avassetreader can 1 me method call when song geting played want show visualization. code have first, generic rendering method takes pointer averaged sample data, , returns uiimage. note these samples not playable audio samples. -(uiimage *) audioimagegraph:(sint16 *) samples normalizemax:(sint16) normalizemax samplecount:(nsinteger) samplecount channelcount:(nsinteger) channelcount imageheight:(float) imageheight { cgsize imagesize = cgsizemake(samplecount, imageheight); uigraphicsbeginimagecontext(imagesize); cgcontextref context = uigraphicsgetcurrentcontext(); cgcontextsetfillcolorwithcolor(context, [uicolor blackcolor].cgcolor); cgcontextsetalpha(context,1.0); cgrect rect; rect.size = imagesize; rect.origin.x = 0; rect.origin.y = 0; cgcolorref leftcolor = [[uicolor whitecolor] cgcolor]; cgcolorref ri...

WSO2 BPS - BPEL tutorial needed -

i'm evaluating bpel engines upcoming project , @ moment have oracle bpel process manager , wso2 bps on list. requirement : need create simple bpel process (exposed asynchronous web service), can invoke external web service , wait asynchronous callback. need able use xsd files has data types input , output of web service (bpel process). so far : have managed download , setup eclipse plugin , server executable test scenario. the question : there tutorial, sample or documentation how using wso2 bpel eclipse plugin. any appreciated :) cheers! buddika you can download wso2 developer studio here has eclipse bpel plugin. can find recent blog post kalpa here sample not contain asynchronous invocations or correlations. hope start you. can find ws-bpel specification sample azeez here . has asynchronous invocations , correlations, not have step step guide. if familiar enough bpel editor, can try sample own. can find webinar here , demonstrates implementing sim...

c# - What is the easiest way to implement a naming convention on an existing project? -

i have inherited project little bit of labyrinth - there no naming convention either, makes difficult parse. it's incredibly frustrating misread line because of , waste hour or two. is there automated way to, instance, ensure methods have capital letter, public variables have capital letter , private variables prefixed underscore? i myself, project large , not effective use of time. what advice can give me coping this, short of "suck up!" ? :) the project in c#, , using vs2010. you can partially automate code cleanup if happen have resharper (you should! no, really, if don't have run copy), stylecop , , stylecop resharper plugin. setting (defining stylecop rules et all) non-trivial task though. depending on code base size, might or might not profitable investment.

How do I find a value anywhere in a SQL Server Database using c#.net? -

how find value anywhere in sql server database using c#.net? roughly put, first have query database scheme in order tables: select table_name information_schema.tables then, navigate through resultset, using returned table names in new query select column_name information_schema.columns table_name = [resulting table name previous query] from here can cycle each column , create select statement using column value = '[searchterm]'.

java - Optimizing code for more clearness and efficiency -

this code works fine, need simplify more clearness , more efficiency: int = 0; if (p.cap()) n++; if (p.creditcard()) n++; if (p.email()) n++; [...] if (p.price()) n++; if (p.url()) n++; if (p.zip()) n++; if (n == 0) p.standard(); as code says, need call multiple methods (i don't know finite number of them). every p. ()* method returns boolean value, , n incremented if value returned true. if n==0 (this happens when every method called returns false) need call p.standard() . how can write more clear , efficient code? tried or condition , this: if (!( p.cap() || p.email() || p.isbn() || p.number() || p.phone() || p.price() || p.time() || p.url() || p.zip() || p.creditcard() )) { p.standard(); } but didn't work (example: if p.cap() returns true other methods not called). i need call every method. you did not specify if every method has called, seems want call them regardless of individual results. use simple or operator: | (not short...

asp.net - Validators in DetailsView insert mode -

i have changed defaultmode property of details view insert since wanted create default insert form sql server table. wish add validators, requiredfieldvalidator,regularexpressionvalidator etc. so possible? if not, there shortcut way create insert form database table in asp.net sqlform in python framework web2py( refer here )? convert boundfields templatefield , open edititemtemplate of each templatefield add validation controls.

facebook - Requests dialog not closing -

i have been using requests dialog quite happily until morning when has stopped working correctly. when submitting dialog or cancelling it, dialog becomes stuck , not close , therefore not call it's callbacks. sits there, blank, doing nothing. image here: http://i.stack.imgur.com/2o0rw.png any ideas problem or how fix it? or case of wait facebook fix code , roll out? thanks update: similar issue facebook app request dialog box keep on loading/busy changing server port 80 fixed issue. i'm experiencing issue -- created new app site url points non-standard port , made no difference (in case i'm seeing auth dialog not closing because callback never received). temporary workaround: create ssh tunnel port 80 non-standard port. you'll have root if you're on unix box, of course. i've filed bug facebook: https://developers.facebook.com/bugs/276500519124789

ruby on rails - Comparing Time.now with model dates -

my project model has 2 datetime atttributes: start_date , end_date. want projects current time in between these dates. tried start_date start with: @projects = project.where(:start_date <= time.now) but returns error: comparison of symbol time failed any ideas? thanks! unlike orms, active record doesn't augment symbol class methods allow expressions other equality expressed in way. have do project.where('start_date <= ?', time.now) the squeal gem adds sort of stuff , allows write project.where{start_date < time.now}

webdriver - Null Ponter while running selenium code in JUNIT 4 -

i trying run code null pointer exception. using junit 4.10 , selenium 2.24.1 jars. the exception in @after " driver.quit(); " when run same code in home desktop seems work fine. difference run eclipse indigo @ home , run eclipse ganymede here. dont think should issue, unless mistaken. stack trace: java.lang.nullpointerexception @ framework.ford.teardown(ford.java:36) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) at org.junit.runners.model.frameworkmethod$1.runreflectivecall(frameworkmethod.java:45) thanks. public class ford { static private webdriver driver; static private string baseurl; static private stringbuffer verificationerrors = new stringbuffer(); @before public void setup() throws exception { drive...

winrt xaml - How do you change the background color of a live tile at runtime? -

i'm trying change background color of live tiles on windows 8 application @ runtime. possible? have code snippet? background color specified in app manifest. not seems possible. the same can emulated sending custom time @ runtime appropriate background image (for color). quirky way, little mind can think of approach only.

Java - Best way to grab ALL Strings between two Strings? (regex?) -

this question has been bugging me long time i'm looking efficient way grab strings between 2 strings. the way have been doing many months through using bunch of temporary indices, strings, substrings, , it's messy. (why java not have native method such string substring(string start, string end) ? say have string: abcabc [pattern1]foo[pattern2] abcdefg [pattern1]bar[pattern2] morestuff the end goal output foo , bar . (and later added jlist) i've been trying incorporate regex in .split() haven't been successful. i've tried syntax using * 's , . 's don't think it's quite intention since .split() takes 1 argument split against. otherwise think way use pattern , matcher classes? i'm fuzzy on appropriate procedure. you can construct regex you: // pattern1 , pattern2 string objects string regexstring = pattern.quote(pattern1) + "(.*?)" + pattern.quote(pattern2); this treat pattern1 , pattern2 literal text, , ...

jsf 2 - EJB not serialized in Managed Bean -

my application server websphere application server v8. have session scoped managed bean in have injected ejb (ejb 3.0) using @ejb annotation. ejb stateless. @managedbean @sessionscoped public class mybean extends basebackingbean implements serializable { @ejb private idetails custinfo; i analyzing session data , noticed notserializableexception java.io.notserializableexception: com.ejb.ejslocal0sldetailsimpl_081f812d @ java.io.objectoutputstream.writeobject0(objectoutputstream.java:1184) @ java.io.objectoutputstream.defaultwritefields(objectoutputstream.java:1537) @ java.io.objectoutputstream.writeserialdata(objectoutputstream.java:1502) @ java.io.objectoutputstream.writeordinaryobject(objectoutputstream.java:1420) @ java.io.objectoutputstream.writeobject0(objectoutputstream.java:1178) @ now tried mark ejb transient , works fine without throwing notserializableexception exception. @ejb private transient idetails custinfo; is correct implementation or can...

apache - Directory permissions after git push using post-receive hook -

i realize there many posts regarding suspect part of issue might not running apache correctly. before looking @ core.filemode first need both local , server files/directories using same user/group? i've read running apache user example - better way of setting things up?

arrays - drupal admin.inc, loop list_modules as form settings -

i need loop values of $blocks = array(); $blocks['list_modules'] with this: $form['advanced']['custom_acc'] = array( '#type' => 'select', '#title' => t('module title'), '#options' => array( 0 => t('no control'), 1 => t('controlled'), ), ); so should become something like this while (list(, $value) = each($blocks)) { echo " $form['advanced']['custom_->blocks array value'] = array( '#type' => 'select', '#title' => t('->blocks array value'), '#options' => array( 0 => t('no control'), 1 => t('controlled'), ), ); "; } but of course not working, got ideas? guess have use foreach, hope can see im trying achieve, thanks in advance! fixed myself :) $blo...

objective c - Passing NSMutableArray from one View Controller to a function in another -

i've read on couple of questions here on passing data between 2 view controllers , seen different ways suggested of doing it. problem follows: i have view controller (lets call "a") has searchbar in toolbar. nothing else. have view controller ("b") responsible displaying popover view when user presses search button on keyboard when searching in searchbar. works. user enters text, presses search button, popover shown. great. now have yet display search results in popover tableview , trying pass nsmutablearray function in b argument: in b.h: @property (nonatomic, retain) nsmutablearray *searchresults; in b.m: @synthesize searchresults; -(void)setsearchresults:(nsmutablearray *)resultarray{ [self.searchresults removeallobjects]; [self.searchresults addobjectsfromarray:resultarray]; } in a.h: #import "b.h" @property(nonatomic, retain) b *viewcontrollerobjectb; in a.m: @synthesize viewcontrollerobje...

image - How to set background into Android Gridview? -

i need set image background in android gridview. have code using image view load images. following codes codes, please me out solve issue. public void oncreate(bundle savedinstancestate) { if(!isnetworkavailbale()){ toast.maketext(getapplicationcontext(), "internet connection not available", toast.length_short).show(); finish(); } super.oncreate(savedinstancestate); setcontentview(r.layout.gridview); gridview gridview = (gridview) findviewbyid(r.id.gridview); gridview.setadapter(new imageadapter(this)); gridview.setonitemclicklistener(new onitemclicklistener() { public void onitemclick(adapterview<?> parent, view v, int position, long id) { log.d("taust","sds"); toast.maketext(nueshoundrssactivity.this, "item co" + position, toast.length_short).show(); } }); } imageadapter package com.nues.rss; import android.content.context; import andr...

javascript - Could not create SSL/TLS Secure Channel -

i'm sometimes getting error - seems happens sometimes. if refresh page, seems fix itself. ideas? the request aborted: not create ssl/tls secure channel. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.net.webexception: request aborted: not create ssl/tls secure channel. from code: string thirdurl = "https://api.facebook.com/method/users.getinfo?uids=" + facebookuserid + "&client_id=" + appcode.facebook.application_id + "&access_token=" + accesstoken + "&fields=first_name,last_name,current_location,email,birthday,sex,pic_square,locale&format=json"; httpwebrequest apithirdrequest = (httpwebrequest)webrequest.create(thirdurl); streamreader apithirdresponse = new streamreader(apithirdrequest.getresponse().getresponsestream()); //error on line below --> string more...

sql server - Select qty of minimum customerID -

product_code month qty area customerid ------------ ----- --- ---- ---------- 820300182 01 1 m1 100078 820300182 01 50 m1 100168 820300182 01 20 m1 100188 820300182 01 10 m1 100618 820300182 01 10 m1 100938 820300182 01 20 m1 100988 820300182 01 25 m1 110158 i want qty of minimum customerid . e.g., product_code month qty area customerid ------------ ----- --- ---- ---------- 820300182 01 1 m1 100078 assuming want find record lowest customerid: select top 1 [product_code], [month], [qty], [area], [customerid] [table] order [customerid] asc if need find record least quantity change order to order [qty] asc

c# - Devexpress SearchlookUpEdit search mode -

Image
i'm using devexpress searchlookupedit v 11.2. , search mode, if write example (value01 value02) works following sql code : where myfield %value01% or myfield %value02% but want do, : (and, not or) where myfield %value01% , myfield %value02% i didn't find property set or that, wrote extension method filter data me, that, should handle event of (typing in find panel). ? , right way filter data ? so, did have such behavior following : create user control using popupcontaineredit , popupcontainercontrol , gridcontrol : i've handled editvaluechanged event of popupcontaineredit executing search method, , have control on when search algorithm should executed, i've used system.windows.forms.timer

node.js - using redis-node (nodejs) with utf-8/16 (russian, chinese, japanese characters) -

has successuflly used russian/chinese/japanese characters redis-node or other redis library (using nodejs) store/receive messages & redis (2.0 , above)? believe encoding/decoding of these messages upto client, not redis. if so, of libraries provide encoding/decoding or there library 1 can use purpose? working code examples appreciated. using utf-8 redis works - if use redis-cli, make sure pass in raw parameter read russian/chinese/japanese characters (otherwise characters not appear correctly in redis-cli). can retrieve them correctly using api jedis/redis-node etc. hope helps!

javascript - Converting Express 2.x app to Express 3.0 app -

i'm learning nodejs , express trying convert tutorial app express 2.5.9 3.0. code below throws error "500 error: failed lookup view "views/login". 3.0 way of getting render now? apps authentication views login.jade routes.coffee ... server.js and in routes.coffee routes = (app) -> app.get '/login', (req, res) -> res.render "views/login", title: 'login' stylesheet: 'login' module.exports = routes to find out directory express using find views need check following setting of view engine: app.set('views', __dirname + '/some-dir'); this didn't change in 3.x. if need further migrating following guide might useful: https://github.com/visionmedia/express/wiki/migrating-from-2.x-to-3.x

c# 4.0 - Open SQL Server CE database data from read only file system -

i use sql server ce database application. program located on dvd. i cannot read data database on dvd, set sql connection string mode read doesn't work (i want read data db) error: opening database read-only requires temp path specified. [ db name = c:\users\ali\appdata\local\temp\rar$ex52.280... ] please help! in order open sql server ce database file (sdf) on read-only media, need add 2 additional parameters connection string mode=read only temp path=[path] you follows: connectionstring = string.format(@"data source = {0}\{1};mode = read only;temp path={2}", databasedirectory, databasename, system.io.path.gettemppath()); if getting connection string app.config see https://stackoverflow.com/a/10731515/19624 string connectionstring = configurationmanager.connectionstrings["myconnectionstring"].connectionstring; connectionstring += ";mode = read only;temp path=" + system.io...

c# - Standard way dynamically set theme based Images for Windows Phone -

i setting images theme in mainpage.xaml.cs public mainpage() { initializecomponent(); setthemeicons(); } private void setthemedicons() { uri u; if ((visibility)application.current.resources["phonedarkthemevisibility"] == visibility.visible) { u = new uri("/images/img_dark.png", urikind.relative); } else { u = new uri("/images/img_light.png", urikind.relative); } btnsessionsearch.source = new bitmapimage(u); } this seems inferior coding me. main reason have every image in application going theme sensitive. ideal way bind image directly in xaml. how theme aware ? take @ themedimageconverter can use in way: <image stretch="none" source="{binding converter={staticresource themedimageconverter}, converterparameter={staticresource phonebackgroundcolor}}" datacontext="/wp7sampleproject4;component/images/{0}/appbar.feature.camera.rest.png" />

Uniqueness of Android phone meta data -

i need know info listed here standard android smartphone: imei imei sv system version baseband version kernal version build number how many items here unique device. how tamper-proof - other imei (first item) know can illegally 'unblocked'. what odds (percentage) 2 devices duplicate data. by 'unique' mean specific the actual instance of device; not model. have finger-prints yours unique you.

php - mktime forcing date to December 1969 -

i having interesting problem mktime function. looked @ solutions offered on here prior , none seemed resolved or helped (strotime doesn't change results see). i have monthly report trying make error-proof possible users, i'm requesting month , year. provide best day report in code. my form has drop-down selection months, , values month two-digit integers (01, 02, etc). year four-digit, filled out manually user. every works great until year 2038... know, know, it's long way off, project supposed have 20-year scope , in last 2 years, i'm running issues. here's how i'm receiving information form: $month = filter_var($_post["month"], filter_sanitize_number_int); $year = filter_var($_post["year"], filter_sanitize_number_int); then, use mktime combine month , year day (27th): $timestamp = mktime(0,0,0,$month,27,$year); then assign variable in date form mysql likes: $reportdate = date('y-m-j',$timestamp); i...

css - Horizontal sub menu flexible width -

i have horizontal navigation want have horizonyal sub nav come off of. issue having sub nav display inline while has absolute position. know there issues using inline display when have absolute position. works how want fixed display, not want fixed... know alternative this? can't have set width on sub nav because each of sub menu's going different width's. <style> ul li { float: left; position: relative; } #primary-nav ul li ul { position: relative; top: 42px; display: none; width:100%; } #primary-nav ul li ul li { list-style:none outside none; margin-left:20px; float:left; z-index: 1000; } #primary-nav ul li:hover ul { display:inline; position:absolute; } </style> <ul class="menu"> <li>menu item</li> <li>drop down</li> <ul class="submenu"> ...

linux - Android app wont copy for beta run? -

i trying manually copy app on android phone can test run thing in live environment. reason no matter place try send app comes error: cp:ommiting directory '/dir/to/app' this sudo...so maybe since running arch should try going 100% super user. any tips awesome!

python - ImportError: No module named isodate -

i cant import rdflib in python. error detailed: python 2.7.3 (default, jun 27 2012, 23:48:21) [gcc 4.6.1] on linux2 type "help", "copyright", "credits" or "license" more information. >>> import rdflib traceback (most recent call last): file "<stdin>", line 1, in <module> file "/usr/local/lib/python2.7/site-packages/rdflib/__init__.py", line 65, in <module> rdflib.term import uriref, bnode, literal, variable file "/usr/local/lib/python2.7/site-packages/rdflib/term.py", line 49, in <module> isodate import parse_time, parse_date, parse_datetime importerror: no module named isodate i grateful if can help. thanks. if install rdflib via pip , dependencies come along (isodate included): pip install -u rdflib or easy_install -u rdflib chances might have installed directly source, meaning have take care of deps yourself. information on installing pip...

django - Passing python's file like object to ffmpeg via subprocess -

i have django filefield, use store wav files on amazon s3 server. have set celery task read file , convert mp3 , store filefield. problem facing unable pass input file ffmpeg file not physical file on hard disk drive. circumvent that, used stdin feed input stream of file django's filefield. here example: output_file = namedtemporaryfile(suffix='.mp3') subprocess.call(['ffmpeg', '-y', '-i', '-', output_file.name], stdin=recording_wav) where recording_wav file is: , stored on amazon s3 server. error above subprocess call is: attributeerror: 'cstringio.stringo' object has no attribute 'fileno' how can this? in advance help. edit: full traceback: [2012-07-03 04:09:50,336: error/mainprocess] task api.tasks.convert_audio[b7ab4192-2bff-4ea4-9421-b664c8d6ae2e] raised exception: attributeerror("'cstringio.stringo' object has no attribute 'fileno'",) traceback (most recent call last): file ...

objective c - Downloading an XML file on an iPhone, storing it and then using it -

i coding application using xml document retrieve data (i using libxml2.2.7.3). set load local xml-file (in project in xcode, along other project files). found wanted able edit xml file , have instant updates on application. fetch data xml document this: nsarray *dagensretlist = [self getallitems:@"//dagensret" filename:@"dagensret.xml"]; i thought easiest way come around download xml-file whenever there new version of document available webserver provide (on every application launch / clicking refresh button download new file server - maybe let check whether have same tag (weeknumber, it's danish coded application)) so thinking on convenient way download file , should keep way of fetching data or more wise keep document on server , read directly server everytime? (it end using lot of traffic, it's product school user-base around 1200, less not using smartphone) how download file webserver , keep cached? you should cache file on device i...

c++ - Class members and inheritance -

i lost. have class editor , class controller . classes workfloweditor , workflowcontroller derive editor , controller respectively. class controller has protected member editor editor , class workflowcontroller has private member workfloweditor editor (with same name). edit eitant : here's simplified code snipped illustrate op has described: class controller { editor editor; // ... } class workfloweditor : public editor { // ... }; class workflowcontroller : public controller { workfloweditor editor; // ... }; my application module graphical interface. in workflow mode, ribbon appears on launch, , wizard displayed. on click on 1 button, method in class controller called. execution crashes because @ time, editor editor class member of object type controller dead. class member editor editor same class member workfloweditor editor (same name). in other words, if class a has member of class b , class childa (derived a ) has member...

java - JSF: invoke method if conversion fails -

in jsf, how can invoke method in case of conversion failing on of input fields? guess can write own converters , stuff there, isn't there more simple way? you use prerenderviewevent listener, , in method check if validation has failed. listener method called every time before view rendered. e.g. consider following facelet: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" > <h:body> <h:messages/> <f:event listener="#{onerrorbean.onprerenderview}" type="prerenderview" /> <h:form> <h:inputtext value="#{onerrorbean.test}" label="test" required="true" /> <h:commandbutton value="submit" action="#{onerrorbean.onsuccess}" /> </h:form> </h:body> </html> and followin...

Multiple errors when trying to integrate barcode scanner application in my own android application -

i'm pretty new in android programming, sorry if going ask dumb questions. i'm creating application, , i'm trying integrate zxing barcode scanner, following instructions here: http://code.google.com/p/zxing/source/browse/trunk/android-integration/src/com/google/zxing/integration/android/intentintegrator.java what i've done far. i've created buttons application, , put action on click button supposed use zxing scanning. value: intentintegrator. i've copy-pasted code link file intentintegrator.java package. following advices given in eclipse i've created intentresult class in com.google.zxing.integration.android package. here in moment. 2 days i've been reading advices, opinions, i've done started beginning didn't work. i'm trying again. can tell me please, step step, how integrate app in own? or if right i've done far, why when run android project on emulator, @ least 20 errors, these exemple: http://s17.postimage.org/n9w5lddof/er...

php - Adding new categories and subcategories - Magento -

what need add new categories , subcategories .csv file. can create new root category, don't know how make subcategory: $category = mage::getmodel('catalog/category'); $category->setstoreid(0); $rootcategory['name'] = 'reserved'; $rootcategory['path'] = "1"; // root category $rootcategory['display_mode'] = "products_and_page"; $rootcategory['is_active'] = 1; $category->adddata($rootcategory); $parentcategory= $category; // doesn't work, want here (root) category id try { $category->save(); } catch (exception $e){ echo $e->getmessage(); } csv file formatted this: root_cat_id;subcat_id;subcat_name;subsubcat_id;subsubcat_name; ex. 1;2;animal;3;dog; how can id of added category, , add subcategory related category? thanks in advance to make category child of category, set path parent categories path before saving it. $childcategory->setpath($parentca...

web services - API to get list of movies by actor or director? -

i looking api download list of movies when search term actor, actress or director. so if actor = "tom cruise", list of movies. if director = "james cameron", list of movies directed. i have checked sites use imdb's api search movie title or imdb id. same rottentomatoes . i aware of imdb's text files . any ideas? http://api.themoviedb.org/2.1/methods/movie.getinfo

Bulk insert into SQL Server 2005 issue -

i've tried bulk insert can't right. have table schema starts id , few more columns need skip column. whats proper way assign columns each 1 csv? thanks edit: my code: bulk insert datadb 'c:\datainsert.csv' ( firstrow=2, fieldterminator = ',', rowterminator = '\n' ) go the errors talking first column being different datatype since have id column i have tested same , working without issues. please post metadata of table , csv file, chance find issue.

language agnostic - When using an ORM to represent a table, is it wise to have non-table specific functions? -

for example (not verbatim) /** @entity */ class event { /** @column */ protected $time_start; /** .. */ protected $time_end; /** getters, setters, etc */ /** @return duration of event string, non-table function */ public function getduration() { ... } } or should orm table, , nothing more? this subjective view, has own opinions, in programming there , things , things shouldn't do. wondering if 1 of cases. not, not idea. if nothing else, violating single responsibility principle . if making orm, instances should deal data storage/retrieval. in example getduration() part of domain business logic , should reside within domain objects . basically, dealing here difference between data mapper , active record patterns. and, if trying write code adheres solid principles, 1 consider active record antipatter, in long term causes unmitigated technical debt .

ruby - Is there a usable rendering context in sinatra/padrino? -

i attempting use exhibit pattern in padrino application need access rendering context. is, need have object context such calling along lines of context.render('accounts/index') produce identical output when render 'accounts/index' called inside controller (assuming variables set same , app/views/accounts/index.erb template file). i can't find within padrino public api, attempted dig deeper. existing render method in controller wraps sinatra's render method, private instance method. it's not not defined on class myapp (i.e. padrino::application subclass). myapp.new results in instance of rack::session::cookie rather of itself, , none of padrino methods can find return existing instance of app, suitable candidate context object if called private render method. is that's inherently difficult bother given sinatra's , padrino's designs, or there i'm missing here? i realise answer in objects on rails book if i'd ke...

Python - Undefined class name after dynamic import -

i'm using python weeks , i'm confronted issue dynamic import. have file test.py in class defined. use class after dynamic import of test.py file. my final goal more complex simplified still same problem. file : test.py class test : def __init__ ( self ) : print ( "instance" ) file : main.py def allimports ( ) : __import__ ( "test" ) what : >>> import main >>> main.allimports() >>> myinstance = test () traceback (most recent call last): file "<stdin>", line 1, in <module> nameerror: name 'test' not defined i cannot specify in fromlist element test.py have import because i'm not supposed know them. what should ? for solution closer intent: import importlib def allimports(globals): mod = importlib.import_module('test', globals['__name__']) try: keys = mod.__all__ except attributeerror: keys = dir(mod) ...