Posts

Showing posts from February, 2013

java - Playing Online Videos one by one -

i have xml file videoview: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/back" android:orientation="vertical" android:screenorientation="landscape"> <videoview android:id="@+id/videoview_concept" android:layout_width="match_parent" android:layout_height="match_parent" /> </linearlayout> and java part is: public class playvideos extends activity implements oncompletionlistener{ public integer index_val=0; @override public void oncompletion(mediaplayer mediaplayer) { index_val++; videoview videoview= (videoview)findviewbyid(r.id.videoview_concept); checkdbconn(); videoview.setvide

c# - MVC Razor view: XML node parsing issue -

i have mvc application querying lucene/solr index. in partial view, displaying metadata on series of xml documents returned query. metadata extracted xml documents using xpath queries , paged, listing 10 documents @ time. view cshtml follows... @model solrmvctest2.models.facet <section> @foreach (system.xml.xmlnode doc in model.searchresult.selectnodes("/response/result/doc")) { <article> <b>document type: @doc.selectsinglenode("//str[@name='doctype']").innertext </b> <br /> <b>nhs number: @doc.selectsinglenode("//str[@name='crn']").innertext </b> <br /> @doc.outerxml.tostring() </article> <p></p> } </section> i have included display of outerxml debugging purposes , partial listing of results highlights serious issue. each group of 10 documents, innertext of selected nodes not updated each successive document, displays values first documen

.htaccess and PHP caching -

this 1 relatively simple 1 hopefully. launched site , uploaded new server. in uploading .htaccess file, made small mistake , when went correct it, didn't seem update. we deleted .htaccess file altogether , yet reason seems have cached on server... think. have hard refreshed, tried different machines, different browsers , still pulls in dynamic pages. i have never experienced before. does know how force / hard refresh htaccess file>? i'm not understanding describe happenning since deleted file, , you've not said in .htaccess which caused problem, nor resulting impact was. however....you don't need more delete .htaccess file - apache not cache it.

css - positioning Div inside another Div with centered background image? -

Image
i have div has image of world map centered inside it. , there div within div. what trying put texts inside second div , place on top of world map image. can without problem when resize browser, seems second div moves original place! i have demonstrated issue in images bellow: on browser resize this: and here css: #body{ top:0px; } #wrapper{ position:absolute; width:100%; top:0px; left:0px; right:0px; bottom:0px; min-width:100%; } #flagholder a:link, a:active, a:visited{ font-family:verdana, geneva, sans-serif; color:#333; text-decoration:none; margin-left: auto ; margin-right: auto ; } #header{ background-image:url(img/bg-header_footer.jpg); width:100%; height:250px; } #footer{ background-image:url(img/footer.png); width:100%; height:250px; } #content{ } #flagholder{ width:80%; border-radius:15px; border:solid 2px #ecf0f1; } #mapholder{ background-image:url(

html - Tumblr Static Page, deleting inline CSS -

Image
i trying create couple of static pages on tumblr blog creating. when using html option creating static page, whenever try submit html inline-styling tumblr deletes it, example <div style="margin-top:35px;"> becomes <div> on submitting. is how tumblr set or there missing here? tumblr detele inline styling if you're using standard layout, switch custom layout , you'll able write html want result here: http://dustyprophet.com/test

C# WinForms changing database name in other form -

so here first question , first c# program: i need function permanently change connection string. my program has structure: main form form1 , when click button, options , new - form3 , user can log in (password protects changing options) , if login successfull create new form - form4 . in constructor of form4 , pass sqlconnection object form1 . want change database name clicking on button, here code: var config = configurationmanager .openexeconfiguration(configurationuserlevel.none); var connectionstringssection = (connectionstringssection)config .getsection("connectionstrings"); var x = connectionstringssection .connectionstrings["app.properties.settings.ppsconnectionstring"] .connectionstring; string[] words = x.split(';'); words[1] = "initial catalog="+textboxdb.text; x=string.join(";", words); connectionstringssection .connectionstrings["app.properties.settings.ppsconnectionstring"] .connectionstring = x; //a

php - TypeError: Value does not implement interface HTMLInputElement -

i'am trying post form using jquery-ajax, , i'am getting error on posting form on click. typeerror: value not implement interface htmlinputelement here javascript code: $('document').ready(function () { $('#update').click(function () { jquery.post("update_category", { c_id: c_id, c_name: c_name, c_description: c_description }, function (data, textstatus) { if (data == 1) { $('#response').html("thank you!!..we soon..!!"); $('#response').css('color', 'green'); } else { $('#response').html("some error occurred"); $('#response').css('color', 'red'); } }); }); }); my form : <div id="form"> <form> <!-- pront drop down here !--> <input type=

Delete column without deleting merged cells - excel vba -

how can delete left-most column of merged cell without deleting content? for instance, range("a1:c1") merged .value="hi" by doing range("a2").entirecolumn.delete(xlleft) , not lose merged cell (which becomes range("a1:b1") , lose content. why not hold value in temp variable: sub deletecolumnretainmergedcellvalue() 'select merged cells, run subroutine. dim v string v = selection.cells(1, 1).value selection.cells(1, 1).entirecolumn.delete selection.cells(1, 1).value = v end sub is you're looking for? if not, please explain little more.

ios6 - iOS UITableViewController with paging dynamically -

my question - how make uitableviewcontroller with paging ? for example, have send request gives me information count of science articles. on uitableviewcontroller present information in tableview static cells, , if want see information article should swipe left or right , animation transition between controller, see same controller information. basically main complexity uitableviewcontroller , because if uiviewcontroller , can implement huge amount of solutions icarousel , many others, tableviewcontroller can't make same solutions. happy if recommend solution. uitableview think inherits uiscollview, can try saying [tableview setpageenabled:yes]; if doesn't work, try getting subviews of table view [tableview subviews]; and 1 of elements scroll view, read documentation sure allowed manipulate hirearchy of uitableview if else fails, add gesture control tableview , put in vertical gestures , call method scrolltorowatindexpath:atscrollposition:

sequence - R: How to use output of 'translate' function to write a table? -

i have file ( data.txt ) contains 2 dna sequences (orf): data = readdnastringset(file="data.txt") data # dnastringset instance of length 2 # width seq names #[1] 57 atgacccccacctccatccccacacttctatcccgctgccccgcctctctcccctaa gpg #[2] 54 atgacccatgagcaccatgcagccaaaaccctgggaatcggcaaagccatctag pfk i want convert them aminoacids: t=vector(mode="list", length=length(data)) (i in seq_along(data)) { t[[i]]=translate(data[[i]]) } t #[[1]] #19-letter "aastring" instance #seq: mtptsiptllsrcpaslp* #[[2]] #18-letter "aastring" instance #seq: mthehhaaktlgigkai* then write table , have output using: tt=do.call(rbind,t) write.table(tt,"aa.txt",sep="\t\t") but these commands don't work. couldn't find problem. how can write table? note: translate function [ seqinr ] , readdnastringset function [ biostrings ]. i don't know why need seqinr . bio

Facebook Ads Api issues with CPC as bid_type parameter when creating ad groups -

does have idea isn't working here , if noticed exception i'm seeing? wanted prepare october changes announced fb , seems when creating ad groups 1 need use cpc/cpm bid types, need define max bid differently etc. here's call: curl -f "campaign_id=xxxxxxxx" -f "bid_type=cpc" -f "bid_info={'clicks':111}" -f "name=test" -f "adgroup_status=1" -f "targeting={'countries':['us']}" -f "creative={'title':'test','body':'test','image_hash':'cf689a9aed4769fc4c8192569fda9f5e','link_url':'http://mylink.com/','type':1}" -f "redownload=1" -f "https://graph.facebook.com/act_xxxxxxxx/adgroups?access_token=token"` and here's response fb api: [error] => stdclass object ( [type] => exception [message] => please specify locations on facebook want show ad impressions.

java - How to customize the way JAXB parses xml? -

i working jaxb since 2 days please forgive me if question easy. tried google didn't find interesting. used jaxb generate java classes based on xsd schema. tested, works, when make jaxb parse xml (which satisfies schemas) receive real objects full of data. great. question is, if possible generate kind of dictionary during parsing of xml? somehow possible register handler called during parsing ? how achieve it? for example let's in xml being parsed there line this: <bookedtrip tattoo="2" rph="100" direction="inward" bookstatus="hk"> i able extract bookedtrip.direction = inward . guess can using kind of handlers xml parser.

mysql - How do you manage a large video database? -

i have tried giving id , storing title, path , rest in mysql database. looks simple. there robust way out there that. i'm not sure looking for. but... basically there 2 way deal "binary large objects". the first 1 store them called blob column in db. the second one, is, now, store in db "pointers" actual data on external storage solution. "path" referencing files on file-system.. both solutions have pro , cons. regarding performances, data migration, load balancing, , on. has been discussed elsewhere on so: mysql binary storage using blob vs os file system: large files, large quantities, large problems when using mysql blob recommended?

vb.net - String.Contains not working as expected -

i have 54,000 files each different method of naming , need check whether filename contains particular string. however, can't find ways of getting select statement work correctly. my code fails unexpectedly. please can tell me why string "bar" not found in "baritone"? dim tempcheck string = "1st baritone" dim goodone boolean = false select case tempcheck case tempcheck.contains("corn") goodone = true case tempcheck.contains("horn") goodone = true case tempcheck.contains("bar") goodone = true case tempcheck.contains("trom") goodone = true case tempcheck.contains("eup") goodone = true case else goodone = false end select try this: dim tempcheck string = "1st baritone" dim goodone boolean = false select case true case tempcheck.contains("corn") goodone = true

php - stored procedure returns different columns -

we've been running stored procedures on ms sql database though odbc using php. whenever run sp returns same 2 column names, regardless of sp run. if results set has more 2 columns, first 2 returned. it's it's got stuck on results previous query. when run on own, in php file containing sp, every sp returns 2 columns same titles before, regardless of number of columns or column titles should returned. contents of columns matches first 2 columns expect. example: looking contact in address book returns following column names of sp executed morning, contained 2 columns in result set. 01234 567890 | john 01234 567890 | alice when should return 01234 567890 | john | smith | m 01234 567890 | alice | chalk | f with column names 'number' 'fname' 'sname' , 'gender'. code is: $query = "{call dbo.storedproc('functionname', $search, 'id')}"; $resultset = odbc_prepare($connection, $query); odbc_execute($resu

Django Admin Template Missing after S3 Setup -

i'm running django locally using heroku, static + media files hosted on s3. however, admin templates have gone missing. i've followed config - django template path - template_dirs file follows: project_path = os.path.realpath(os.path.dirname(__file__)) template_dirs = (project_path + '/templates/') template_loaders = ( 'django.template.loaders.filesystem.loader', 'django.template.loaders.app_directories.loader', ) i've noticed browser still looking admin css files on s3 but, first time setting , deploying, i'm bit lost how configure properly.

android - can't set alertdialog size -

i have problem alertdialog has fixed max size perfect square side length of min(parent width, parent height) . creates problem can't alertdialog wide screen. in dialog, have loaded imageview show image. want image shown wide screen , not in square - makes smaller. code alertdialog in acivity: alertdialog.builder alertadd = new alertdialog.builder(mainactivity.this); layoutinflater factory = layoutinflater.from(mainactivity.this); final view view = factory.inflate(r.layout.schematic_image_view, null); alertadd.setview(view); alertadd.show(); code xml file schematic_image_view.xml : <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout_root" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="0dp"> <imageview android:id="@+id/schematic"

ios - setExclusiveTouch ignored when using UISwipeGestureRecognizer -

Image
i have 2 uiviews (custom scroll views) respond uiswipegesturerecognizer . these 2 uiviews subviews of parent uiview . want allow one of subviews respond recognizer. in other words, 1 should allowed swiped @ time. setting setexclusivetouch = yes on subviews and/or parent view doesn't have effect. how can make sure 1 subview being swiped @ time? here's picture: uiscrollview's default have multipletouchenabled set yes - if not need multiple touch (zooming example requires it), set no.

c# - Exclude starts with but include ends with -

i can't figure out myself, have match string starts asp. , ends _aspx , need exclude start of match (the asp. part). for example, string input = "random stack trace text asp.filename_aspx random text"; regex r = new regex("regular expression needed!!!"); var mc = r.matches(s); foreach (var item in mc) { console.writeline(item.tostring()); } and have needs output this, filename_aspx that's job positive lookbehind assertion : regex r = new regex(@"(?<=\basp\.)\s+_aspx"); (?<=\basp\.) ensures asp. present before starting position of match, doesn't include in match result. \b word boundary anchor asserts don't match wasp , asp . \s+ matches 1 or more non-whitespace characters (this assumes filenames don't contain spaces).

android - Embed Video in DreamweaverCC and Phonegap not working correctly -

hi all. i making dreamweavercc mobile app. have working through phonegap build , can .apk. however html 5 "video" tag dose not seem working correctly. for instance , following works correctly when linked movie on internet, , can play video correctly , without problem on phone. <video poster="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/teddy_bear_27.jpg/250px-teddy_bear_27.jpg" controls> <source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4"> </video> however local video file display place holder , show "controls" keeps showing spining box if "loading" never dose: <video width="560" height="340" controls> <source src="videos/broken_compas.mp4" type='video/mp4; codecs="avc1.42e01e,mp4a.40.2"'> </video> so question : why android not picking embedded video ? remember , been packed through dre

c# - System.FormatException of a string -

this question has answer here: how escape braces (curly brackets) in format string in .net 7 answers i'm getting system.formatexception: input string not in correct format when running method. the values of fields: arrayname = "requester"; fieldlist = "\"name\" : \"shimshon\""; // "name" : "shimshon" public override string tostring() { var val = string.format("\"{0}\" : { {1} }", arrayname, fieldlist); return val; } the expect result of method is "requester" : { "name" : "shimshon" } what wrong format? i think want: var val = string.format("\"{0}\" : {{ {1} }}", arrayname, fieldlist); note doubled {{ , }} escape sequence necessary braces literally output.

Python Decimal - engineering notation for mili (10e-3) and micro (10e-6) -

here example bothering me: >>> x = decimal.decimal('0.0001') >>> print x.normalize() >>> print x.normalize().to_eng_string() 0.0001 0.0001 is there way have engineering notation representing mili (10e-3) , micro (10e-6)? here's function things explicitly, , has support using si suffixes exponent: def eng_string( x, format='%s', si=false): ''' returns float/int value <x> formatted in simplified engineering format - using exponent multiple of 3. format: printf-style string used format value before exponent. si: if true, use si suffix exponent, e.g. k instead of e3, n instead of e-9 etc. e.g. format='%.2f': 1.23e-08 => 12.30e-9 123 => 123.00 1230.0 => 1.23e3 -1230000.0 => -1.23e6 , si=true: 1230.0 => 1.23k -1230000.0 => -1.23m ''' sign = '' if x < 0:

r - Extracting binary data from a mixed data file -

i trying read binary data mixed data file (ascii , binary) using r, data file constructed in pseudo-xml format. idea had use scan function, read specific lines , convert binary numerical values can't seem in r. have python script this, job in r, python script below. binary section within data file enclosed start , end tags , . the data file proprietary format containing spectroscopic data, link example data file included below. quote user manual: data of bindata elements written binary array of bytes. each 8 bytes of binary array represent 1 double-precision floating-point value. therefore size of binary array numberofpoints * 8 bytes. two-dimensional arrays, data layout follows row-major form used safearrays. means moving next array element increments last index. example, if two-dimensional array (e.g. data(i,j)) written in such one-dimensional binary byte array form, moving next 8 byte element of binary array increments last index of original two-dim

manipulating the output of itertools.permutations in python -

i want take list, instance list = [1,2,2] , , generate permutations. can with: newlist = [list(itertools.permutations(list))] and output is: [[(1, 2, 2), (1, 2, 2), (2, 1, 2), (2, 2, 1), (2, 1, 2), (2, 2, 1)]] the problem: itertools.permutations returns list of length 1 entry list of permutations of list. is: newlist[0] == [(1,2,2),(1,2,2),(2,1,2),(2,2,1),(2,1,2),(2,2,1)] and newlist[1] not exist. i want output list each entry 1 of permutations. is newlist[0] == (1,2,2) newlist[1] == (1,2,2) newlist[2] == (2,1,2) ... newlist[5] == (2,2,1) the question: there command produce permutations of list in way? failing that, there way access 'individual elements' of [list(itertools.permutations(list))] can things them? >>> itertools import permutations >>> list(permutations([1,2,2])) [(1, 2, 2), (1, 2, 2), (2, 1, 2), (2, 2, 1), (2, 1, 2), (2, 2, 1)] you don't need put in list again. i.e don't [list(permutations(...))] (by

jquery - Is building big portions of page in javascript bad? -

on existing project working on, noticed many of developers building big portions of pages javascript. example: $( targetdiv ).append("<div>"); $( targetdiv ).append(" <div class='info'>"); $( targetdiv ).append(" <div id='modes'>"); $( targetdiv ).append(" <table cellspacing='0'>"); $( targetdiv ).append(" <tbody>"); // more... i understand using javascript build certain elements on page. content dynamic , know when page first loads (ajax stuff). however, of code (not shown) not dynamic , build same way every time. no 'if' statements or loops is there reason why 1 build large parts of pages using javascript vs having html part of html doc? think 1 want minimize javascript html generation because more confusing , harder write. also, javascript html generation has hurt performance ( does it? ) i "newer" javascript dev

Kettle transformation with muli input streams -

i have 2 files single fields. looks like: file file b a1 b1 a2 b2 a3 b3 a4 b4 i have a1,b1; a2,b2 when connect 2 inputs transformation kettle says inputs have different layouts you don't have details of transformation, guess picked 'append streams' step. should use merge join step , 2 'add sequence' step add line nr input (set different counter name both steps). connect 2 'add sequence' steps 'merge join' step configure key fields line number , set join type to: 'full outer'. next can use select values step rid of line number columns.

Android Map Clustering Using Polaris 2 -

i'm making app android , i'm using android map show 15k markers webservice, map gets slow, have searched around , find solution "clustering" can't implement in app, map running lib "polaris 2" , tried "clusterkraf", had no results. if has better way show markers or way make clustering please me. i have been using android map extensions , clusterkraf, decided implement clustering self. clustering written in simple way , more control in how elements showing in map, etc. you can read implementation of clustering in http://arnaldog.wordpress.com/2013/07/31/simple-clustering-with-android-maps-v2/ . i hope helps you.

android - The notification doesn't appear? -

i have notification: private void sendsimplenotification(){ boolean permanent = preferencemanager.getdefaultsharedpreferences(context).getboolean("permanent", false); if(permanent) { notificationcompat.builder notificationbuilder = new notificationcompat.builder(service.this); notificationbuilder.setcontenttitle("title"); notificationbuilder.setcontenttext("context"); notificationbuilder.setticker("tickertext"); notificationbuilder.setwhen(system.currenttimemillis()); notificationbuilder.setsmallicon(r.drawable.ic_stat_icon); intent notificationintent = new intent(this, service.class); pendingintent contentintent = pendingintent.getactivity(this, 0, notificationintent, 0); notificationbuilder.setcontentintent(contentintent); notificationbuilder.setdefaults(notification.default_sound | notification.default_lights | notification.default_vibrate);

c++ - IIS 6 Isapi filter - forward or redirect requets to other domain -

a code bellow main part of isapi filter iis 6. need redirect request contains "/some_string" other url, lies on other domain , other server. how it? dword camgnisapifilter::onpreprocheaders(chttpfiltercontext* pctxt, phttp_filter_preproc_headers pheaderinfo) { char buffer[256]; dword buffsize = sizeof(buffer); bool bheader = pheaderinfo->getheader(pctxt->m_pfc, "url", buffer, &buffsize); cstring urlstring(buffer); urlstring.makelower(); if (urlstring.find("/some_string") != -1) //we want redirect file { urlstring.replace("/some_string",""); urlstring = "http://new_domain.cz/something" + urlstring; char * newurlstring= urlstring.getbuffer(urlstring.getlength()); pheaderinfo->setheader(pctxt->m_pfc, "url", newurlstring); return sf_status_req_handled_notification; } //we want leave alone , let iis handle return s

How to use jQuery on() when a element is "ready" rather than an event received? -

i'm trying build half-transparent menu (and other things), codes this: $(".hover-opaque").on({ load: function () { $(this).addclass("opacity02"); }, mouseenter: function() { $(this).removeclass("opacity02"); $(this).addclass("opacity1"); }, mouseleave: function() { $(this).removeclass("opacity1"); $(this).addclass("opacity02"); } }); when it's loaded (or, "ready"), addclass("opacity02") make half transparent, , when mouse entered, make opaque addclass("opacity1"), , when mouse leave, opposite side again. so far mouseenter , mouseleave work well, "load"(or "ready") not work. of course can this: $(".hover-opaque").addclass("opacity02"); but heard cannot deal ajax-generated contents. so what's problem? by way, tri

c++ - Gold linker: specify alignment of sections -

i want specify alignment sections. ld 2.20.0 following approach works: create linker script containing sections should aligned, e.g.: sections { .data align(0x40): { *(.data) } .text align(0x40): { *(.text) } .plt align(0x10): { *(.plt) } } then link with: -rpath-link=/path/to/linkerscript.ld /path/to/linkerscript.ld e.g. include script in rpath-link , pass 1 of object files. now, when linking in same way using gold 2.23.1 , script rejected error: linkerscript.ld: sections seen after other input files; try -t/--script so gold wants me specify complete linker script, want change couple attributes. possible? i have tried: passing script -t option. produces broken executable fails start. understand because -t accepts complete linker scripts, while above "annotation" existing script. in same vein, when passing script -t option ld 2.20.0 fails link since sections unspecified. not "complete" linker script use case. so have

java - Certificate chain different between HTTPSURLconnection and Apache (System) DefaultHttpClient -

i facing weird issue wrto apache https client. trying connect external https website has basic authentication turned on (ssl server authenticaion only). here summary of tests , conclusions. use either of chrome/firefox/ie connect website -> success use javax.net.ssl.httpsurlconnection -> success use either of defaulthttpclient or systemdefaulthttpclient -> failure i tried debug enabling "javax.net.debug" "ssl". noticed both clients pick same trust store (default jdk trust store) , use same protocol (tlsv1). however, differences here i noticed following extension returned jdk extension server_name, server_name: [host_name: websitehostname] while above extension missing in apache web client debug log. also, 1 more difference saw in certficate chain the below response jdk native * certificate chain chain [0] = [ [ version: v3 subject: **cn=websitename , ou=domain control validated - rapidssl(r), ou=see www.rapids

import - Ant task imported from build.xml in Gradle script is running automatically -

i have java project there import ant build.xml file tasks, this: ant.importbuild 'build.xml' task mytaska(dependson: ':modules:mymodule:assemble') << { // stuff here... } compilejava.dependson(mytaska) configure(jar) { include 'classes.dex' } jar.dependson(antcompile) the task antcompile comes ant build.xml script. however, reason, task being called @ start when invoke gradlew assemble , it doesn't wait jar task start. also, antcompile task defined following target in build.xml: <target name="antcompile" depends="-setup"> </target> that ant target, -compile always first task executed when invoke gradlew assemble . doesn't make sense. task never invoked anywhere, it's dependency of antcompile . why being executed? this is, obviously, not want... how can prevent such behaviors? seems work expected. build script makes jar depend on antcompile , according words depends on -

Working code to import tab delimited txt file with more than 255 fields into two Access Tables -

this code below import tab delimited file on 255 fields 2 tables. make sure when design 2 tables fields have correct data types fields being imported. created tables using access import text file wizard. before using wizard deleted fields after 255 create first table , deleted first 255 create second table. hopes helps , below helped me project. public sub importtextfile() ' use adodb.recordset, sure have reference set ado dim rst adodb.recordset dim rst2 adodb.recordset dim strfile string dim strinput string dim varsplit variant dim intcount integer set rst = new adodb.recordset set rst2 = new adodb.recordset ' change table name here rst.open "appsimport1", currentproject.connection, adopendynamic, adlockoptimistic rst2.open "appsimport2", currentproject.connection, adopendynamic, adlockoptimistic ' change text file name , location here strfile = "g:\home\riskmgtreports\autodatabase\creditappex

android - How to get active engine object in OpenSLES -

i facing problem in using opensles on android 2.3. when tried create engine object, got following error: slcreateengine while engine active i know opensles android(2.3? because didn't find issue on android 4.x) supports single engine, don't know engine from. is there interface in opensles check whether there active engine or not? thanks in advance hints! this boggling me of time application works, every , find error occurs leading unusable opensl engine, noted on android 2.3. the sl_result_resource_error can thrown varitude of reasons, instance pthread error, out-of-memory etc. these return appropriate error codes. it's more boils down application architecture, there multiple bits of code create engine object or there 1 entry point ? can't retrieve active engine objects opensl, must store pointers/references engine objects pass slcreateengine-method. might idea check status (and close engines) prior running create engine method, possible firing

javascript - Update user object in parse.com -

how can update user object in parse?i know must logged user modify security reason. code don't works :post https://api.parse.com/1/classes/_user/xj3qllyy07 400 (bad request) var user = parse.user.current(); console.log(user); user.save(null, { success: function(user) { user.set("email", "pty"); user.save(); } }); for parse.user object, need explicitly set email address (see api documentation ): var user = parse.user.current(); user.setemail("email", options);

javascript - does a click also trigger a mouseout in chrome -

i'm testing ratings module i'm working on, had idea simple construction that'd allow smooth ajax based voting, found odd.. the contruction 2 divs, 1 nested in other show stars, mousing on sets width, translated percent vote later on. in testing this, found worked, when clicked, made width of inner div reset, if moused out, i'm not sure understand why yet. i'm including working example of this. http://www.nogumallowed.com/test.php here fixed code: $(".ratingsblock").mousemove(function(e){ $(".ratingsscale").width(e.offsetx); }); $(".ratingsblock").click(function(e){ $(this).attr("score",e.offsetx); }); $(".ratingsblock").mouseleave(function(e){ $(".ratingsscale").width($(this).attr('score')); //$(".ratingsscale").animate({width:$(this).attr('score')+'px'}, 500); }); i changed mouseout function mouseleave, , made rating's score up

How to use codenameone cloud features? -

i have been using parse backend codenameone project. use codenmaeone cloud services instead. there documentation , examples of how this? page 111 in developer guide: http://www.codenameone.com/developer-guide.html there javadoc: https://codenameone.googlecode.com/svn/trunk/codenameone/javadoc/com/codename1/cloud/package-summary.html and additional info in blog regarding new tools: http://www.codenameone.com/3/post/2013/04/cloud-object-viewer.html there discussion forum can search , ask questions: http://www.codenameone.com/discussion-forum.html

sql server - Get columns and types for all tables -

i need table names , column types sys.columns . tried this: select object_id sys.columns but object_id gives value , not exact name. you can use object_name() function name of object given object_id . and can join onto sys.types view type name: select c.object_id, object_name(c.object_id), c.name, t.name sys.columns c join sys.types t on t.system_type_id = c.system_type_id;

performance - Why is Linq that slow (see provided examples) -

this linq slow: ienumerable<string> iedrdatarecordids = dt1.asenumerable() .where(x => x.field<string>(inputdataset.column_arguments_name) == sargumentname && x.field<string>(inputdataset.column_arguments_value) == sargumentvalue) .select(x => x.field<string>(inputdataset.column_arguments_recordid)); ienumerable<string> iedrdatarecordids_filtered = dt2.asenumerable() .where(x => iedrdatarecordids.contains( x.field<string>(inputdataset.column_datarecordfields_recordid)) && x.field<string>(inputdataset.column_datarecordfields_field) == sdatarecordfieldfield && x.field<string>(inputdataset.column_datarecordfields_value) == sdatarecordfieldvalue) .select(x => x.field<string>(inputdataset.column_datarecordfields_recordid)); ienumerable<string> ievalue = dt2.asenumerable() .where(

c# - Unit testing strategies for NHibernate Repository -

i'm using nhibernate , repository pattern on large project , trying establish service layer unit testing strategy , having problems getting in head. it's possible i'm approaching unit testing incorrectly, , it's possible i'm approaching repository pattern incorrectly, i'm not sure which. a simplified subset of scenario looks this: public class userrepository : repositorybase, irepository { public userrepository() {} public userrepository( isession sessionparam ) { session = sessionparam; // member of repository base } public string getusernamefromemail( string emailaddress ) { return session.queryover<members>().list().where( u => u.emailaddress.tolowerinvariant() == emailadrress.tolowerinvariant() ).firstordefault().username; } } my unit testing concept would fake nhibernate's isession , pass in 1 returned list of users fit scenario i'm trying test (for instance, email address case-insensitive) (i can&

html - horizontal height is different between Chrome and Firefox -

the page chrome , ff different, seems border in chrome inside li, height 130px, in ff, border outside, height 150px. i have added more info code. <div class="service_promos cf"> <ul> <li> <h2><a>item1</a></h2> </li> <li> <h2><a>item2</a></h2> </li> </ul> </div> here css: .service_promos { margin-top: 0; } .service_promos ul { width: auto; margin: 0; padding: 0; list-style: none; list-style-image: none !important; } .service_promos li { background: none; border-bottom: 10px solid #e2e1d6; border-left: 10px solid #e2e1d6; border-right: 10px solid #e2e1d6; min-height: 130px; margin-top: 0 !important; padding-right: 1em; list-style-type: none; padding: 1em 2em; display:block; } .service_promos h2 { float: left; margin-left: 5%; m

Why C# allows initializing static class variables in non-static contructor? -

why c# allows initializing static class variables in non-static contructor? static variables should allowed initialized on static constructors. ideas? public class customer { public string name; public customer() { name = "c1"; console.writeline("creating customer " + name); } } class program { public static customer cust; public program() { cust = new customer(); //why allowed i.e. initialize static variable in non-static constructor? } static void main(string[] args) { program program = new program(); program = new program(); console.read(); } } don't @ initializing, @ setting. if initialized via static constructor or @ declaration, add readonly keyword. e.g. public readonly static customer cust; //allowed static program() { cust = new customer(); } //not allowed public program() { cust = new customer(); }

highcharts - Redrawing the tooltip inside of the tooltip positioner callback -

i'm using i'm using tooltip formatter function control of tooltip, including adding custom css create arrow on side of tooltip box facing mouse. using positioner callback not determine placement of tooltip, when changes 1 side of mouse other i'm updating formatter callback switch side of tooltip arrow lies on (see code below). works fine, except first point causes tooltip switch sides of mouse. clear tooltip's "formatter" function called before tooltips "positioner" function ( reasons obvious ). however, prevents me correctly drawing tooltip when changes sides. need able in positioner callback update formatter function, , redraw tooltip. possible? positioner: function (boxwidth, boxheight, point) { // set variables var chart = this.chart; var plotleft = chart.plotleft; var plottop = chart.plottop; var plotwidth = chart.plotwidth; var plotheight = chart.plotheight; var distance = 40; var pointx = point.plotx;

How to display a form answer if it matches the answer in an array in php -

i've been trying learn php , practice, made array of family guy characters based off last name. tried asking question in form , wanted code check array see if matches correct answer in array. i'm still new php, learning experience. code looks this... <?php $families = array( "griffin" => array( "peter", "louis", "chris", "stewie", "meg" ), "quagmire" => array( "glen" ), "brown" => array( "cleveland", "loretta", "junior" ) ); ?> <html> <head> </head> <body> of these family guy characters part of griffin family? <form action = "familyguyquestions.php" method = 'post'> a: <input type = "radio" name = "cleveland">cleveland b: <input type = "radio" name = "glenn">glenn c: <input type = "radio" name = "meg">meg d: <i

html - Changing CMS to wordpress will change my URLs, how to cope -

i moving ranked ecommerce site wordpress, old site has urls end in .htm . want avoid breaking links, , avoid losing pagerank, wordpress removes periods custom urls, seems ending in .htm not option. what best way handle situation in terms of seo? preserve sitemap different urls , 301 redirect? use kind of url rewriting trick? appreciated. check out plugin: http://wordpress.org/plugins/redirection/ you can manually add redirects .htaccess not sure if work in case though. worth shot, nevertheless. make sure put these rules after wordpress' own block of rules redirect 301 /about.html http://yoururl.com/about/ redirect 301 /contact.html http://yoururl.com/contact/

symfony - association mapping when one entity isn't managed by Doctrine -

i have 2 entities in one-to-one association. first, person , stored in mysql database , handled doctrine. second, aduserrecord , describes activedirectory user record. read-only. not need know person . also, aduserrecord properties should never stored in mysql db privacy reasons. an aduserrecord retrieved using service, adsearcher , can search samaccountname or objectguid . whenever search successful, service checks see if there corresponding person record , creates 1 if there not. works fine. my problem occurs when start person object. mostly, don't need access person 's aduserrecord i'd prefer not query active directory unless it's required. means, think, person::getadrecord() needs have access adsearcher service. this: public function getadrecord(){ if($this->adrecord) return $this->adrecord; $searcher = ???; //get adsearcher service somehow $record = $search->getrecordbyuserguid($this->ad_guid); if(!$record) throw new

javascript - Jquery the toggleSlide,function doesnt work why? -

i'm trying slide info doesn't work. here code: <div class="article"> <div id="ebook1">ebook1</div> <div id="infoofebook1"> download ebook1 here. </div> </div> <script type="text/javascript" src="http://code.jquery.com/jquery-2.0.3.js"> $(document).ready(function(){ $("#ebook1").click(function(){ $("#infoofebook1").slidetoggle("slow"); }); }); </script> you don't put code inside script tag src. change this: <script type="text/javascript" src="http://code.jquery.com/jquery-2.0.3.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#ebook1").click(function(){ $("#infoofebook1").slidetoggle("slow"); }); }); </script>

xml parsing - SED - stripping certain tags from XML file -

i have xml files littered tags this: <?xm-insertion_mark_start author="some_author" time="20050602t125956-0500"?> how strip such inserts? i've tried avail: sed -e 's/<\?xm.*?\?>//g' in.xml > out.xml instead of substitute (s) use delete (d) command of sed: also use sed -i (inline) this: sed -i.bak '/<?xm.*?>/d' in.xml using grep: grep -v '<\?xm.*\?>' in.xml > out.xml caution: shell utilities not best tools parsing & editing xml data.

c++ - What does object.operator do? -

this question has answer here: why explicitly calling operator<< on std::cout cause unexpected output? 2 answers i saw following code: cout.operator << ("hello"); and thought same as: cout << "hello"; but prints: 0x46e030 how work? can do? object.operator<<(??); not quite same std::ostream::operator<<(std::ostream&, ??) , because excludes non-member (free) functions. the std::ostream::operator<< members are: basic_ostream& operator<<( short value ); basic_ostream& operator<<( unsigned short value ); basic_ostream& operator<<( int value ); basic_ostream& operator<<( unsigned int value ); basic_ostream& operator<<( long value ); basic_ostream& operator<<( unsigned long value ); basic_ostream& operator<<( long lon

asp.net - How to use a custom web control? -

Image
i create control encapsulates following controls: i've recreated html (excuse ugly table usage until clean divs , css) in control .ascx file: <%@ control language="vb" autoeventwireup="false" codefile="multilevelreportfilter.ascx.vb" inherits="controls.multilevelreportfilter" %> <%@ register tagprefix="cc1" namespace="unlv.iap.webcontrols" assembly="dropdownchecklist" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="generator" content= "html tidy linux/x86 (vers 25 march 2009), see www.w3.org" /> <title></title> <style type="text/css"> /*<![cdata[*/ tr.c2 {display: none;} td.c1 {font-weight: bolder; color: red; font-size: 10pt;} /*]]>*/ </style> </head> <body> <table width="98%" cellspacing="0" cellpadding="15" align=&q

validation - PHP: how to validate access to options in a menu depending on user/group? -

i have php page shows several links options (i.e. simple menu), need validate logged in user and/or assigned group see if have access each option. let me explain example. my "menu.php" page has simple html listing of links, e.g.: option1.php option2.php option3.php ... optionn.php [i obviating html code, showing logic] now, each option should visible groups , or users. example, group 1 has access options 1,2,5, group 2, options 2,4,5, group 3 options 1 , 6, usera options 3,4, userb options 4,6 , on. i need have permission either single user or group give access, in other words, or condition, either group or user, not necesarily both. i receive both user , group via $_session variable, can validate directly. now, best way structure script validate each options permision? i don't have option use databases store permisions, need within code (hard coded). an idea have create several arrays, both each option, , in each store ids of each group , user ha

sql - How to Count Total No.of Columns of a Table(I am in Oracle 10g) -

this question has answer here: how count number of columns in table using sql? [duplicate] 3 answers as can count total no.of rows select count(*) table thanks you can use data dictionary. like select count(*) all_tab_columns owner = <<owner of table>> , table_name = <<name of table>> this assumes code/ session has select access on table in question. if table in schema, use user_tab_columns instead , omit owner . if want view columns of tables don't have access to, use dba_tab_columns instead you'd need additional privileges.