Posts

Showing posts from January, 2010

android - Web page not Avaible Go another class or show an image -

1-)i have webview project.sometimes im forgot internet connect.and showing webpage not available.when if want go class or show error.xml bad displaying. all. public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.webplayer); customviewcontainer = (framelayout) findviewbyid(r.id.customviewcontainer); webview = (webview) findviewbyid(r.id.webview); adview adview = (adview) this.findviewbyid(r.id.adview); adrequest adrequest = new adrequest.builder().build(); adview.loadad(adrequest); mwebviewclient = new mywebviewclient(); webview.setwebviewclient(mwebviewclient); mwebchromeclient = new mywebchromeclient(); webview.setwebchromeclient(mwebchromeclient); webview.getsettings().setjavascriptenabled(true); webview.getsettings().setappcacheenabled(true); webview.getsettings().setbuiltinzoomcontrols(true); webv

ios - Delete object from user class in Parse.com -

i'm trying delete image connected current user imageone column in parse.com. user class. pfquery *query = [pfuser query]; [query selectkeys:@[@"imageone"]]; [query getobjectinbackgroundwithid:[[pfuser currentuser] objectid] block:^(pfobject *object, nserror *error) { if (!error) { [object deleteinbackground]; } }]; my code doesn't work , console logs error "user cannot deleted unless have been authenticated via login or signup" . how can fix this? seems problem comes fact object (image) comes user class, right? why doing query users , doing delete current user, that's worst possible way structure query (and fail). if current user isn't in first 100 returned above code never find match. this sort of query should instead done using getobjectinbackgroundwithid:block: , in case of current user have object, this: [[pfuser currentuser] deleteinbackground]; if instead want delete information in column, use follo

java - Syntax Error: Import statement with multiple semi-colon -

this might weird question, valid one. know below statement not have compilation error: arraylist list = new arraylist();;; //(with 3 `;` semi-colon) okay have written below import statement: import java.util.arraylist;;; (with 3 `;` semi-colon) but got below compilation error: syntax error on token ";", invalid staticimportondemanddeclarationname why? what have here: arraylist list = new arraylist();;; //(with 3 `;` semi-colon) is not statement terminated 3 semi-colons. it's statement terminated 1 semi-colon, followed 2 empty statements . an empty statement legal in java, import section of java source file not comprised of statements, it's comprised of import declarations. jls 14.6 defines empty statement: an empty statement nothing. emptystatement: ; execution of empty statement completes normally. a perhaps-legitimate use of empty statement: //loop forever while (true) {;} // body of loop empty statement.

MyStile theme custom top menu woocommerce -

Image
i want customize woocommerce theme mystile. how change top menu "item" (items) stück? this can changed by: go appearance -> editor , find file theme-woocommerce.php open file , find line echo '<span class="contents">' . sprintf(_n('%d item', '%d items', $woocommerce->cart->get_cart_contents_count(), 'woothemes'), $woocommerce->cart->get_cart_contents_count()) . '</span>'; change "item" , "items" "stück". save file , should changed.

python - Matplotlib - Chart using patch circles with size equivalent to error bars. Scaling issue. Circles are squashed? -

i trying produce chart using patches. code below, know why these end being squashed , not circular, want? unfortunately not have enough rep post picture... sample code self contained, i.e. should able run generate graph. patches seem change shape when plot resized. them stay fixed. import numpy np import matplotlib.pyplot plt import matplotlib.patches patches import matplotlib.transforms transforms matplotlib.font_manager import fontproperties matplotlib.pyplot import * mypath = ['1,0.25','2,0.5','3,0.35','4,0.40'] fig = plt.figure() ax = fig.add_subplot(111) distances = [] confidence_intervals = [] line in mypath: distances.append(float(line.split(',')[0].strip())) confidence_intervals.append(float(line.split(',')[1].strip())) ind = np.arange(len(distances)) data = np.array(distances) y_error = np.array(confidence_intervals) circles = [] in range(len(ind)): ax.scatter(0, data[a], s=60, color='black')

ios - enumerateBodiesAlongRayStart prints "Chance" to console in Xcode 6 -

i'm using enumeratebodiesalongraystart , method prints word "chance" console. there way suppress this? whats deal? self.gamescene.physicsworld.enumeratebodiesalongraystart(self.raystart, end: self.rayend, usingblock: { body, point, normal, stop in }) i have same "problem". seems debug output in /applications/xcode6-beta6.app/contents/developer/platforms/iphonesimulator.platform/developer/sdks/iphonesimulator.sdk/system/library/privateframeworks/physicskit.framework/physicskit. hopefully removed in beta7. edit gfrs: not removed. exists in xcode 6 gm. edit 2 gfrs: still not fixed. exists in xcode 6.1

Monitoring AJAX requests between a Flash applet and a server via a Google Chrome extension -

i playing flash-only game uses ajax communicate server. problem data "drawn" , of not copy/pastable, end retyping urls , similar stuff parts of (i.e., chat). i thought i'd make simple page action extension chrome intercept ajax communication between game , server, way developer tools can it, , display data i'm interested in (parsing urls , similar stuff no-brainer). however, looking around internet, i've found no info on how this. many sites (including answers questions here) mention using developer tools (i'd prefer having page action extension, simple enough share other players, other automation welcome well), mention chrome.webrequest (which seems able provide headers),... i thought of making content script along lines of this answer , since i'm trying read data between flash applet (not web page) , server, don't think injecting javascript code possible. so, question is: can done and, if yes, how? in case got wrong idea, aim of monito

android - ParseQueryAdapter for ListFragment -

as parsequeryadapter meant used activity - general design idea using parsequeryadapter listfragment ? want display custom list view. i've tried use parsequeryadapter listfragment , images not displayed properly. if use exact code activity , images load correctly. how can use parsequeryadapter in conjunction listfragment ? i've posted general code, text query loads wonderfully in list, images don't load or when do..take long time show up. <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <listview android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@android:id/list" android:divider="@null" android:dividerheight="0px" /> </relativelayout> public cl

xamarin.ios - Detect backspace in UITextField in iOS8 -

for detecting backspace, i've overridden deletebackward method (should work ios5+) var input = new backspacetextfield(rectanglef.empty); etc input.becomefirstresponder(); here's code public sealed class backspacetextfield : uitextfield { public backspacetextfield(rectanglef frame) : base(frame) { } public override void deletebackward () { console.writeline ("deletebackward"); } } when press "backspace" button nothing happens. expect "deletebackward" message should appear environment: ios8, xamarin edit: 0 similar question on objective-c: detect backspace in uitextfield i've done additional check. deletebackward is method uikeyinput protocol, i've check inserttext method, method works perfactly. public override void inserttext (string text) { base.inserttext(text); } i've checked deletebackward on objective-c , works too. do have ideas how detect backspace in uitextfield i

Using reduce with a composite key in couchdb view returns no result on GET -

i have couchdb view following map function: function(doc) { if (doc.date_of_operation) { date_triple = doc.date_of_operation.split("/"); d = new date(date_triple[2], date_triple[1]-1, date_triple[0], 0, 0, 0, 0) emit([d, doc.name], 1); } } when issue request this, whole view's data (2.8mb): $ curl -x http://somehost:5984/ops-db/_design/ops-views/_view/counts % total % received % xferd average speed time time time current dload upload total spent left speed 100 2751k 0 2751k 0 0 67456 0 --:--:-- 0:00:41 --:--:-- 739k however, when add reduce function: function (key, values, rereduce) { return sum(values); } i no longer data when using curl: $ curl -x http://somehost:5984/ops-db/_design/ops-views/_view/counts % total % received % xferd average speed time time time current dload upload total spent left speed 1

sandbox - How do you test PayPal functionality on a customer site as a web developer? -

i can't 1 creating websites customers want use paypal. paypal says have use customers account create account specific sandbox. well, don't want access customers account. don't want know password. there way test paypal functionality without having direct access customers account?

linux - New Apache Server - Trouble with .htaccess -

(pardon me, i've injured right hand i'll have trouble typing) i've set new linux server running off 'lamp stack'. used putty, git , friends. usually, work in pre-set environment - i'm app developer. technically count first 'solo venture'. i've never been given root access server before, there work. so, started, decided port of work previous project , build off of that. relies heavily on rewrite rules. ignorantly, assumed .htaccess file magically work. doesn't - whatever reason, apache wants enable use of rewrite rules (it's not you'd accidentally set .htaccess file, dear me). so, i've read various tutorials, followed guides, asked elsewhere - i'm not getting anywhere. point, here's i've done: 1. enable use of .htaccess files @ /etc/apache2/sites-available/default-ssl.conf: <directory /var/www/html> options indexes followsymlinks multiviews allowoverride

xpages - Multiple database application ACL (part 2) -

i posted question access control multi database application tried putting application. here case. have maindb has acl no roles defined. user clicks button , opens control crud datasource has computed filepath different database call appdb. in appdb acl has several roles defined, , have added myself acl , assigned me roles [admin] , [finance]. in control have added after page load event following: var roles = context.getuser().getroles(); viewscope.put("vsroles", roles); upon opening page viewscope vsroles [] has not recognized have additional set of roles in appdb. appear context.getuser().getroles() gets roles @ authentication time when log maindb.nsf, , not picking roles when open appdb. need use roles configure actions person can perform, plus documents user can read and/or edit. to complicate issue user may switch between multiple target application databases , no doubt have different roles , access each one. response previous question,but might not have expla

html - CSS - Blend edges of image with background image -

Image
so have developing basic website , used images cool light effects change in color hits edge of page, image: so can see light in image reaches edge wanting know, there way blend edges in css or html , not that? i've looked on web , can't find relating problem... thanks in advance! there many ways accomplish that, way take care of edges when producing image. clear , simple. if page has black background, make sure have image background of same color. fade "light effect" same color before hitting edge using favorite image manipulation program. i advice against producing image transparent background - image large , performance smacked. if want experiment fading post-production, use css gradients make image seem fade off @ edges. or use (vendor specific) css3 toys box-shadow (see box shadow on mdn ) produce inset, black shadow. keep in mind though these tricks, specially on such huge images presented, have cost in browser performance (and user experi

Unenhanced performance of matlab GPU computing -

with intention of comparing speed of gpu vs cpu computing, ran example codes available here (a mandelbrot set on gpu) matlab central. below results obtained: case 1 (without gpu): 6.2 secs case 2 (using parallel.gpu.gpuarray): 6.518 secs (1.39 secs in example) case 3 (using element-wise operation): 1.259 secs (0.14 secs in example) as can seen, there no improvement in case 2 , slight improvement of around 4 times in case 3. example did not state details of gpu used, may know if due "incompetency" of graphic card or missing important? the graphic card responsible driving display (hp z display z23i 23-inch ips led backlit monitor). cpu: intel i7-4790, 3.6 ghz (8 cores) gpu: name: 'nvs 510' index: 1 computecapability: '3.0' supportsdouble: 1 driverversion: 6 toolkitversion: 5 maxthreadsperblock: 1024 maxshmemperblock: 49152 maxthreadblocksize: [1024 1024 64]

c++ - Variable changes value unexpectedly -

i have code supposed store data in in 2 block array. here code : #include <iostream> #define position_data 1 #define x_axis 1 #define y_axis 0 using namespace std; typedef int dot_coordinates[position_data]; void set_coordinates(dot_coordinates* dot,int x, int y); int main() { dot_coordinates dot1,dot2,dot3,dot4; set_coordinates(&dot1,0,0); set_coordinates(&dot2,7,0); set_coordinates(&dot3,0,7); set_coordinates(&dot4,7,7); printf("\np1 : x=%d y=%d\n",dot1[x_axis],dot1[y_axis]); printf("\np2 : x=%d y=%d\n",dot2[x_axis],dot2[y_axis]); printf("\np3 : x=%d y=%d\n",dot3[x_axis],dot3[y_axis]); printf("\np4 : x=%d y=%d\n",dot4[x_axis],dot4[y_axis]); return 0; } void set_coordinates(dot_coordinates* dot,int x, int y) { *dot[x_axis] = x; *dot[y_axis] = y; } the console result following : p1 : x=0 y=7 p2 : x=7 y=0 p3 : x=0 y=7 p4 : x=7 y=7 shouldn't y=7 y=0 p1 ? now here happens when replace line

ios - Calling a event method on UI -

i have textfield so: _txtfield1.returnkeytype = uireturnkeydone; how make call submit button pressed method? - (void) submitbuttonpressed { ... make sure class conforms uitextfielddelegate in header file, implement method: - (bool)textfieldshouldreturn:(uitextfield *)textfield { if(textfield == _txtfield1) { [self submitbuttonpressed]; } }

ios - 504 Gateway error only on iPhone -

i getting 504 gateway error when visit website through link in website. happening on iphone though, browsing through website right speak no errors being thrown @ me. tried inputting url through safari manually still gave me same error. has other users seen happen before? if so, how able fix it? if helps, using cellular data connection.

tinyurl - Tiny URL redirection works in browser, but from curl returns 200 instead of 301 -

this looks weird me, may i'm missing obvious. following sample tinyurl: http://tinyurl.com/67lwfe it works browser, redirects desired page. when try using curl following: curl -i http://tinyurl.com/67lwfe it responds 200 instead of 3xx response. thought page might responding meta refresh html tag, tried: curl http://tinyurl.com/67lwfe but responds blank no html or meta refresh tags. question how browser knows redirect properly? i've tried setting browser agents no luck. missing obvious? tinyurl appears serve 200 <meta http-equiv="refresh"> initially, 301s subsequent requests amount of time afterwards, can set cookies (two of them!), run ton of tracking scripts, , slow people down. that say, tinyurl sucks, , url shorteners. question.

ruby on rails - Paperclip uploads on Heroku using S3 -

i'm sorry rehash old gripe i'm @ wits end , not sure go next. using paperclip on heroku , have s3 uploads configured. able things working in local development environment once it's running on heroku run error: aws::s3::errors::permanentredirect (the bucket attempting access must addressed using specified endpoint. please send future requests endpoint. i've googled error , read through heroku documentation , believe have set correctly. thought problems stemmed having bucket in s3-us-west-1.amazonaws.com region, i'm not convinced anymore. here relevant parts of heroku config: aws_region: us-west-1 s3_bucket_name: my-super-awesomely-amazing-bucket from config/environments/production.rb file: config.paperclip_defaults = { :storage => :s3, :s3_credentials => { :bucket => env['s3_bucket_name'], :access_key_id => env['aws_access_key_id'], :secret_access_key => env[

php - How to Send sms to customer mobile if order is placed via Magento admin panel -

i have done sms integration orders placed customer using website. want send sms customer mobile number when order placed admin (site owner) using magento admin panel. in magento admin has option place order customer using admin panel. checkout magento api authentication code details here orders , customers http://www.magentocommerce.com/api/rest/introduction.html#restapiintroduction-createasimpleproductasanadminuserwithoauthauthentication you able see how obtain customer information , order information api or you can check out plugins http://www.magentocommerce.com/magento-connect/sms-notifier.html http://www.magentocommerce.com/magento-connect/order-notification-sms-text-message.html you have enter users phone number , of plugins can send sms notification.

php - Why 2 Clicks needed to submit form -

i submitting form via 2 submit buttons why needs 2 clicks submit form form looks below: <form id="mychkform" method="post" class=""> <input type="email" class="form-control" id="email" name="email" placeholder="enter email" data-original-title="" title="" /> <input type="radio" name="cnt_as" checked="checked" value="cnt_as_guest"/> want continue guest<br/> <input type="radio" name="cnt_as" style="margin-top:10px" value="auth_fm_chk"/> have password <div class="input-group gst_chk"> <input type="submit" class="btn btn-red" id="cntgyes" value="continue guest"> </div> <div class="sggn_in" style="display:none"> <div class="input-g

css - How to display fullscreen(centerCrop) image on android WebView? -

i load image android webview , make imageview 's android:scaletype="centercrop" . i have tried http://css-tricks.com/perfect-full-page-background-image/ . work great on pc's firefox not on android webview. stretch image!! take websetting.setloadwithoverviewmode(false); account nothing changed. only css3 method done. because image background not element. however, encounter using html/css3 , webview scale image screen... white screen before image loads . workaround work great on firefox not in android. do have no choice use imageview ? please try this: for portrait mode, , when image height less image width; _webview.setpadding(0, 0, 0, 0); _webview.setinitialscale((int) (((imageheight-webviewheight)/imageheight)*100)); string html1= new string ("</head> <body style=\"background:url(file:///android_res/drawable/diego.jpg) no-repeat center center\"></body> </html>"); _webview.loaddata

python - Sorting dictionary containing lists -

assuming i've following list of lists: dict1 = [['jeremy', 25, 120000], ['paul', 23, 75000], ['mike', 32, 80000]] i can easily sort lists on index 2 follows: from operator import itemgetter sorted_dict = sorted(dict1, key=itemgetter(1)) print(sorted_dict) >>> [['paul', 23, 75000], ['jeremy', 25, 120000], ['mike', 32, 80000]] things little more complicated dictionary of lists. assuming i've following: dict2 = {'employee1':['paul', 23, 75000], 'employee2':['mike', 32, 80000], 'employee3':['jeremy', 25, 120000]} i can approximate sort on index 2 follows: from operator import itemgetter #first, extract lists result1 = dict2.values() #second, sort list index 2 result2 = sorted(result1, key=itemgetter(1)) #finally, use loop sort dictionary in result2: b in dict2.keys(): if == dict2[b]: print("{0}:{1}".forma

asp.net - How do I upload a file to an Acumatica Screen through HTTP virtual path? -

how upload file acumatica screen through http virtual path? example, upload mysite.com/files/abc.pdf sales orders screen. below code snippet achieve goal.it reading file http url , attaching 1 of existing case. //graph file management px.sm.uploadfilemaintenance filegraph = pxgraph.createinstance<px.sm.uploadfilemaintenance>(); //since need file http url - below sample webrequest request = webrequest.create("http://www.pdf995.com/samples/pdf.pdf"); using (system.io.stream datastream = request.getresponse().getresponsestream()) { using (system.io.memorystream mstream = new system.io.memorystream()) { datastream.copyto(mstream); byte[] data = mstream.toarray(); //create file info, may check different overloads per need px.sm.fileinfo fileinfo = new px.sm.fileinfo("case.pdf", null, data); if (filegraph.sav

android - I want to download a file from from dropbox to my sdcard. -

i found solution @ link : download file dropbox , save sdcard dont know filedownload class here. , api object? it related dropbox core api. @ developer site dropbox: https://www.dropbox.com/developers/core

skydrive - How to use one drive file picker in browser? -

This summary is not available. Please click here to view the post.

java - Iterating over an ArrayList which contains Bean objects with c:foreach,doesn't work -

i'm iterating on arraylist in jsp, contains objects of bean.i want use getter() extract information object.productid 1 of attribute i'm interested in. i'm using jstl purpose.the code follows: <c:foreach items="repo" var="element"> <jsp:usebean id="element" scope="page" class="com.responsebean"/> product:<jsp:getproperty property="productid" name="element"/> </c:foreach> where repo arraylist contains objects of responsebean. list<responsebean> repo=new arraylist<responsebean>(10); code of responsebean follows: public class responsebean implements java.io.serializable { private static final long serialversionuid = 1l; private string productid; public string getproductid() { return productid; } public void setproductid(string productid) { productid = productid; } but i'm getting following excepion http status 500 - cannot find information o

java - Fill a JComboBox with new values -

currently filling jcombobox that: countrybox = new jcombobox(countrylist.toarray(new string[countrylist.size()])); however, when using program countrylist changes , fill jcombobox differently. tried use action change jcombobox: countrybox.addactionlistener(new actionlistener() { countrybox = new jcombobox(countrylist.toarray(new string[countrylist.size()])); } however, not change values. me seems countrybox prefilled data before. recommendations do? i appreciate answer! don't create new jcombobox , create new model defaultcomboboxmodel model = new defaultcomboboxmodel(countrylist.toarray(new string[countrylist.size()])); countrybox.setmodel(model); you create own comboboxmodel proxy current list , that's you. take closer @ how use combo boxes more details

internet explorer - C# SHDocvw.dll Internetexplorer always Busy -

i'm trying automate ie in c#. problem it's busy. i have wait-method private void waitforcomplete() { int elapsedseconds = 0; bool isdocumentbusy = browser.busy; int timeoutseconds = 5; while (browser.busy && elapsedseconds < timeoutseconds) { thread.sleep(1000); elapsedseconds++; } } and 1 of methods public bool forward() { if (browser == null) return false; int loopcount = 10; while (browser.busy && loopcount > 0) { thread.sleep(500); loopcount--; } browser.goforward(); return true; } i tried both sleep in method , wait-method. i have methods switching tabs or create new tabs etc. it's same every method. do have clue whats point of problem? thanks!!! ok found solution. the wait-method correct private void waitforcomplete() { int elapsedseconds = 0; int timeoutseconds = 5; while (browser.readystat

ubuntu - how to route client HTTP requests over multiple NIC with libcurl -

on ubuntu machine, wonder if there way route specific http requests same server - let's say, video provider - on multiple network interface cards (nics). i've heard link bonding , seems outside of control of applicative code. libcurl used perform task ? i think can inspect system configuration detect multiple nics, how translate address read specific interface ? normally outgoing interface depends on routing table. curl supports selecting outgoing interface . --interface <name> perform operation using specified interface. can enter interface name, ip address or host name. example like: curl --interface eth0:1 http://www.netscape.com/ if option used several times, last 1 used. if want use several interfaces same operation (like in article mentioned), need package ifenslave-2.6 . google lists many tutorials how use it.

unlink git branch from svn origin -

this question has answer here: how can avoid accidental dcommit local branch 3 answers this follow-up this previous question . there can find did far. in short, created new git branch branching branch dcommit'ed remote svn repository. new git branch intended used locally , never synchronized svn . while can ensure manullay explained in this answer , new git branch 'remembers' svn origin: $ git svn info path: . url: [path-to-host]/[svn-repo]/trunk repository root: [path-to-host]/[svn-repo] repository uuid: [repository-uuid] revision: [revision] node kind: directory schedule: normal last changed author: sg-lecram last changed rev: [revision] last changed date: [date] so assume if checkout new git branch , commit changes local git , run git svn dcommit sending changes svn . while not plan this, needs forget split-second on branch on publish secr

Connecting neo4j shell to embedded neo4j in java -

[neo4j: 2.1.3, windows 7 64 bit, java 7] i want able connect embedded neo4j database in java, using neo4j shell. suggested here adding property remote_shell_enabled="true" should that. i tried suggested shell not able connect db error caused by: org.neo4j.kernel.storelockexception: unable obtain lock on store lock file: ~\store_lock. please ensure no other process using database, , directory writable (required read-only access) at org.neo4j.kernel.storelocker.checklock(storelocker.java:82) i set property follows in code graphdb = new graphdatabasefactory().newembeddeddatabasebuilder(dbpath).setconfig("remote_shell_enabled","true").newgraphdatabase(); also, doing results in database not shutting down through shutdown hook. instead process not end, seemingly shutdown hook never executed. if use below start property shutdown hook executed everytime. graphdb = new graphdatabasefactory().newembeddeddatabase(dbpath); or

chef - Cookbook to run .bat file with parameters -

i have .bat script deployment task. needed run parameters correct work, smthg this: script.bat -x=param1 -b=param2 -c=param3 ( how looks in cmd on windows ) how correctly specify cookbook run such script? seen done .sh no .bat (yes, need .bat not cmd or ps1) if isn't hard, give example. thx i use batch ressource this batch "run-script" command "script.bat -x=param1 -b=param2 -c=param3" cwd "path script is" action :nothing end and use notification deployment ressource use notifies :run, "bash[run-script]", :immediately if deployment ressource correctly idempotent script run if deploy succeed. fwiw .bat or .cmd roughtly same thing, see windows batch files: .bat vs .cmd?

Get json data in C# -

i have json need value json in c# language. got data json creating class , work. when use same way value json there have error appear. error : 'string' not contain definition 'data' i not sure mistake. how value json , supposedly work. class: public class instacomments { public data[] data { get; set; } public class data { public string created_time { get; set; } public string text { get; set; } public string full_name { get; set; } } } and error appear @ line of code: list dyn = jsonconvert.deserializeobject>(resultcomments.data.tostring());//error on here this json code: "{\"meta\":{\"code\":200},\"data\":{\"created_time\":\"1406056452\",\"text\":\"cool!\",\"from\":{\"username\":\"s19xx_\",\"profile_picture\":\"http:\\/\\/photos-d.ak.instagram.com\\/hphotos-ak-xaf1\\/10499142_14627971139734

regex - PHP extracting data from inbetween delimiters -

$heading = ''; $text = ' *heading 1* text **subheading 1a** more text **subheading 1b** text**subheading 1c** *heading 2* text **subheading 2a** more text **subheading 2b** more text**subheading 2c** '; if(preg_match('#*(+?)#*',$text,$result)); $headings .= $result; if(preg_match('#**(+?)#**',$text,$result)); $headings .= $result; echo $heading; from $text, how possibly extract what's between * in between 1 * heading , whats between 2 ** subheading? the output i'm trying achieve this: heading 1 subheading 1a subheading 1b subheading 1c heading 2 subheading 2a subheading 2b subheading 2c i did put great deal of effort, mind cannot think of anymore. can help? try this: $result = array(); if (preg_match_all('/([*]+[^*]+[*]+)/', $text, $matches)) $result = array_map(function ($v) { return str_replace('*', '

ffmpeg libx264 non-existing PPS 0 referenced -

hello have installed ffmpeg , libx264 based in offical tutorial on ffmpeg installation here : https://trac.ffmpeg.org/wiki/compilationguide/ubuntu i want stream mumudvb , pass ffmpeg h264 encoding when use ffserver -f /path/to/config -d i output : [h264 @ 0x1ab32c0] non-existing pps 0 referenced [mpegts @ 0x2c7cca0] not find codec parameters stream 0 (video: h264 ([27][0][0][0] / 0x001b)): unspecified size consider increasing value 'analyzeduration' , 'probesize' options [h264 @ 0x1ab32c0] non-existing sps 0 referenced in buffering period [h264 @ 0x1ab32c0] non-existing pps 0 referenced [h264 @ 0x1ab32c0] decode_slice_header error [h264 @ 0x1ab32c0] no frame! [mpegts @ 0x1aadca0] decoding stream 0 failed [mpegts @ 0x1aadca0] decoding stream 1 failed input #0, mpegts, 'http://127.0.0.1:9097': duration: n/a, start: 45508.714822, bitrate: n/a program 107 [mpegts @ 0x1aadca0] stream #0:0[0x42e]: video: h264 ([27][0][0][0] / 0x001b)[mpegts @ 0

Capturing Image from web cam in Python -

import cv2.cv cv import numpy np capture = cv.capturefromcam(0) image = cv.queryframe(capture) #here have iplimage imgarray = np.asarray(image[:,:]) #this way use convert numpy ar i using code capture image webcam , want show on canvas,please help.the above code activates web cam without error ,please can either may save iplimage on hard-disk or display on canvas.really urgent.this part of project doing. appreciated i used code using pygame import pygame import pygame.camera pygame.locals import * import pygame.image pygame.init() pygame.camera.init() camlist = pygame.camera.list_cameras() cam = pygame.camera.camera(camlist[0],(640,480)) if camlist: cam = pygame.camera.camera(camlist[0],(640,480)) cam.start() image = cam.get_image() i used code capture image web cam , same but,it not please me either store image on hard-disk or display on canvas import cv2 cam = cv2.videocapture(0) winname = "image" cv2.namedwindow(winname, cv2.cv_window_autosize

javascript - How to slide div content left right..? -

i developing wordpress plugin, have move content in slider left right , right left. tried as: var effect = 'slide'; // set options effect type chosen var options = { direction: 'right' }; // set duration (default: 400 milliseconds) var duration = 700; jquery("#letsee").html(data).hide().toggle(effect, options, duration); see reference jsfiddle so should make run. appling response of ajax. problem: there no effect jsfiddle example, , content coming without effect. how can make slide left right, right left... in advance it seems missed including jquery ui library . jquery ui 1.11.0 hope !

javascript - hide url path from address bar -

is there way (using javascript, php or html) hide url address bar? for example have: www.mysite.it/public/network.php and want only www.mysite.it/public/ or www.mysite.it/public/# my site written in php. is there way (using javascript , php or html) hide url path address bar? no, can create .htaccess file: rewritebase / rewriteengine on rewriterule ^public/$ public/network.php [l]

How can mere mortals examine chromecast crash reports -

i working on chromecast app. unfortunately app , remote debugger hang after minute or two. after point thing can done restart device (or wait minute or 2 longer , device restarts itself). can hands on crash report or resource usage statistics or give me clue going on. this question: is there way analyze chromecast crashes? advises send crash report google , ask them inspect me. don't want that. want inspect myself. possible? no, way access , inspect follow suggested in post.

javascript - Change selected option when clicked -

what trying achieve follows: when user changes selected value in select box, refresh page, add selected text value existing url , reset select box default value selected user before page refresh. any ideas doing wrong? html code: <select class="selectedform"> <option value="one" selected>one</option> <option value="two">two</option> <option value="three">three</option> <option value="four">four</option> </select> javascript code: $(".selectedform").change(function() { $('.selectedform option:contains(' + this.value + ')').prop({selected: true}); alert( $('.selectedform').find(":selected").val() ); if ( window.location.href.indexof("&") > -1 ) { window.location.search = '?towhere=cursos&q='+$('.selectedform').find(":selected").text()

php - Assetic watch suddenly stopped working -

i have issues using php app/console assetic:watch (assetic:dump --watch) command since morning. thursday fine , morning command not see changes when update file. assetic:dump works fine don't want wait 20 seconds each time update css (less) file. has idea of happening ? i rebooted , cleared cache of symfony. i use linux mint (debian based) , cleared /tmp folder. (excuse bad, english, it's not main language) i resolved issue erasing assetic file in /tmp folder right before re-launching watch command.

Create bitmap out of memory in android -

i have following code create canvas size of 8303 × 5540, running code produces outofmemoryexception . scaledbitmap = bitmap.createbitmap(8303, 5540, bitmap.config.argb_8888); how can resolve problem? setting android:largeheap="true" in androidmanifest.xml helped me.

javascript - Horizontal AJAX posts loader, detect when scrollbar reaches the end -

i've set div (#reviewspostscont) overflow-x:scroll, want load posts ajax cant't detect when scrollbar gets right end. down below code have far, can't understand whats wrong it. in advance, matt $('#reviewspostscont').scroll(function(){ var $this = $(this); scrollpercentage = 100 * $(this).scrollleft() / ($('#reviewspostscont').width() - $(this).width()); if (scrollpercentage == 100){ alert('end!'); // test code, ajax } }); the issue around how calculate total scroll width. have added jsfiddle . basically, instead of: scrollpercentage = 100 * $(this).scrollleft() / ($('#reviewspostscont').width() - $(this).width()); you should have: scrollpercentage = 100 * $(this).scrollleft() / ($(this)[0].scrollwidth - $(this).width());

wordpress - Add multiple Widgets Sidebar for specific template? -

i working on wordpress , want know: how can add multiple widgets sidebar template? <?php if ( is_active_sidebar( 'sidebar-bookpost' ) ) : ?> <?php dynamic_sidebar( 'sidebar-bookpost' ); ?> will work different types of widgets? are trying put different sidebar widgets on different pages, or stack multiple widgets in same sidebar? if trying stack multiple widgets, can howlin said , drag many need bookpost sidebar. if want have different sidebars on different pages, can either use plugin widget logic allows show widgets on pages, or little deeper php , functions, , create own custom widget areas.

c# - Load lists from Entity Framework without make the controller wait -

i want load set of list @ begining of web app, use them later. these lists static , read data base using entity framework orm. idea load list @ begining (on home page after login) , use them on de app. don't want home page waiting list finish loagind. have tried several alternatives no 1 works (or goes sync or got errors). 1. first attempt: calling tolistasync() , await tolistasync (throw exception ef) there 2 version of list 1 async , other sync: private static task<list<empresa>> listaempresasasync; public static list<empresa> listaempresas i have defined function generates lists repository on ef public async static task<list<t>> generateasynclistfromrepository(igenericrepositoryblockable<t> repository) { iqueryable<t> queryasync = repository.getallactive(); return await queryasync.tolistasync(); } and other 1 function check result async calls: public static list<t> forcetoloadasynclist(task<list<t>

c++ - how to list USB mass storage devices programatically using libudev in Linux? -

i doing project mass storage devices in linux. trying write application list connected usb mass storage devices , give notification when new mass storage device plugged in. using libudev purpose. have used code found in " http://www.signal11.us/oss/udev/ " . have done modification here /* create list of devices in 'block' subsystem. */ enumerate = udev_enumerate_new(udev); udev_enumerate_add_match_subsystem(enumerate, "block"); udev_enumerate_scan_devices(enumerate); devices = udev_enumerate_get_list_entry(enumerate); the problem list block devices. want usb mass storage devices. how list. 1 more problem how label of usb storage devices using libudev. one solution match devices following criteria: subsystem == "scsi", devtype == "scsi_device" child device exists subsystem == "block" child device exists subsystem == "scsi_disk" parent device exists subsystem == "usb", devtype