Posts

Showing posts from February, 2015

java ee - How to restrict the ejb mdb(messsage driven beans) instances via wildfly 10 standalone-full.xml -

we have following configuration in standalone-full.xml of wildfly10. <subsystem xmlns="urn:jboss:domain:ejb3:4.0"> <session-bean> <stateless> <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/> </stateless> <stateful default-access-timeout="5000" cache-ref="simple" passivation-disabled-cache-ref="simple"/> <singleton default-access-timeout="5000"/> </session-bean> <mdb> <resource-adapter-ref resource-adapter-name="${ejb.resource-adapter-name:activemq-ra.rar}"/> <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/> </mdb> <pools> <bean-instance-pools> <strict-max-pool name="slsb-strict-max-po

Cassandra Spark connector does not return any result when running on a single node cluster -

i using dse 5.0.0. created following table on single node cassandra cluster: create table if not exists dummy ( id uuid, txt text, primary key (id) ); insert dummy(id, txt) values (uuid(), 'hello world'); then when query specific id using spark cassandra connector, not result: val df = sqlc.read.format("org.apache.spark.sql.cassandra") .options(map("table" -> "mytable", "keyspace" -> "myks")) .load() df.show(false) // +------------------------------------+-----------+ // |id |txt | // +------------------------------------+-----------+ // |2b69ddc1-2c15-485d-a30f-1b2d7f86c200|hello world| // +------------------------------------+-----------+ df.filter("id = '2b69ddc1-2c15-485d-a30f-1b2d7f86c200'").show // 16/07/28 08:51:43 debug cassandratablescanrdd: fetching data range (token("id") <= ?,list(-9223372036854775808))

Azure website Rest Api only accept GET, POST returns 403. Possibly CORS -

i encounter strange problem. have asp.net core webapi project running under azure app service (website). using dhc plug-in in chrome. service running aad. i can request method fine (after login). however, when request post, got 403 response. looking around in log, can see this 2016-07-28t08:14:26 pid[x] verbose received request: post https://blahblah.azurewebsites.net/api/build/beep/ 2016-07-28t08:14:26 pid[x] verbose found 'appserviceauthsession' cookie site 'blah.azurewebsites.net'. length: 856. 2016-07-28t08:14:26 pid[x] information sending response: 403.60 forbidden 2016-07-28t08:14:26 pid[x] warning cross-site request forgery detected user 'blah@blahblah.com' referer ''! i using asp.net core 1.0. have cors enable in code (allorigin allheader), cors in azure website has entry '*', supposed accept every origin. log stream seems not hit website, in azure blocks request. any help? edit: success

.net - What should I use spin lock or mutex if conflict doesn't occur often -

i'm fixing 1 bug related concurrent access collections in 1 library. library uses mutex(lock) control access multiple threads. locked areas in code contains code should executed quite fast (modifying list/dictionary or read it) spin lock seems match scenario. but ... in cases lock not necessary because majority of apps uses library single-threaded , important me not slow them down. mine naive benchmark indicates spin lock checks slower resource not used, not trust it. if advertising function thread safe should provide locking on collection updates. if not, make sure document fact , leave consumer.

php - Pinterest scraping pagination parameters -

i scraping pinterest.com, because don't want approve application use official api. able scrape data: pins, boards, likes, followers, etc. pinterest.com gives data 50 first items. have analyzed server's answers when scrolling down page , there dynamic loaded ajax results. request server this this request's parameters are: _ 1469685347816 data {"options":{"username":"humor","bookmarks":["pz8ylje0mdk3ndc4mtkunzaznzu2mty3ntq0odywfgiyn2y2ntlmyzq0y2u0zgu1yjy5zjnkytlkmzm3odeynzi5m2fiywfhymi3ndblodm3zdjkzgu2mmrhogywn2e ="],"is_own_profile_pins":true},"context":{}} module_path app>userprofilepage>userprofilecontent>grid>griditems>pin(component_type=0, show_board=true, use_native_image_width =true, squish_giraffe_pins=none, show_pinner=true, show_pinned_from=false, resource=pinresource(main_module_name =null, id=703756168806524)) source_url /humor/pins several more request's

sql - PostgreSQL 9.5 ERROR: invalid byte sequence for encoding "UTF8": 0xc3 0xee -

recently migrated databases postgresql version 8.4 on debian 5 postgresql version 9.5 on different server running centos 6.5 using pg_dump , pg_restore utilities. database's encoding sql_ascii tables contain huge encoded data. remaining databases seems work normally, specific one. when try fetch data database on new server receive: megaart_www=# select * data_tbl limit 10; error: invalid byte sequence encoding "utf8": 0xc1 0xe0 to sure configurations on both server identical run these commands. results identical. postgres=# show client_encoding; client_encoding ----------------- utf8 (1 row) postgres=# show server_encoding; server_encoding ----------------- utf8 (1 row) database's encoding: megaart_www=# show server_encoding; server_encoding ----------------- sql_ascii (1 row) database server configurations identical, continue receive errors. so server_encoding sql_ascii on new server, client_encoding utf8? it's saying utf

How to search/replace text being copied before sending to clipboard using Javascript/jQuery? -

i managed add text what's being copied using code in this answer (the second option). however, when change string concatenation , add call replace , error "replace not function". copytext = window.getselection().replace(/some pattern/, 'replace value'); // fails the "selection" object seems complex , can't find text inside it. call tostring on that's not option because i'm copying html contenteditable div , need preserve formatting. i'm trying because have relative links in div's content , they're being converted absolute links in copied text reason. happens when accessing my demo rawgit. locally, works normally. any ideas on how accomplish this? update here's jsfiddle current setup: https://jsfiddle.net/8kx8v8pb/ you need cast string ( getselection() returns selection object). either append "" or cast string .tostring() before executing .replace() so in case, code should this: copyte

internet explorer 11 - How to avoid IE11 "slow" evaluation of CSS :invalid and :valid pseudo selectors -

i'm aware of question shows :valid , :invalid pseudo selectors not working @ in ie11: css form:valid selector doesn't work in ie11 yet there example of floating labels: https://snook.ca/archives/html_and_css/floated-label-pattern-css here, ie11 behaving differently. @ first, not seem work. type in fields of form , css supposed apply, doesn't, different chrome , firefox. however, when exit field, or move next field, see css applied, in ie11. if "one behind". i'm facing exact same issue in own implementation, not public. there solution (non-js) work around strange evaluation behavior of ie11? no, , since fixed in edge not in ie11. i did note 1 thing, css changes works on input though, if this? .field, .field label { position: relative; font-weight: bold; display: inline-block; font-family: arial; font-size: 10px; } input { position: absolute; top: 0; border: 1px solid #999; padding: 3px 2px; transi

Php login via email in mysql -

hi guys have loging via email , , want add login via email. when add (login=:login or) in sql query, got bug can login password. here code : public function login($login,$upass) { try { $stmt = $this->conn->prepare("select * klient login=:login or email=:login limit 1"); $stmt->execute(array(':login' => $login)); $userrow = $stmt->fetch(pdo::fetch_assoc); if ($stmt->rowcount() == 1) { if ($userrow['userstatus'] == "y") { if ($userrow['haslo'] = $upass) { $_session['usersession'] = $userrow['idklient']; return true; } else { header("location: index.php?error"); exit; } } else { header("location: index.php?inactive"); exit; } } else {

javascript - Set mindate in bootstrap datepicker -

i have 2 date picker on change of 1st date picker need set selected date mindate value of 2nd date picker . here coe <input type="text" size="30" class="date_picker_from form-control valid" id="start" value="" name="start" aria-invalid="false"> <input type="text" size="30" class="date_picker_to form-control valid" id="end" value="" name="end" aria-invalid="false"> $('.date_picker_from').datepicker({ setdate: new date(), format: 'dd/mm/yyyy', todayhighlight: true, autoclose:true, startdate: '-0m', mindate:0, }); $('.date_picker_to').datepicker({ //setdate: new date(), format: 'dd/mm/yyyy', todayhighlight: true, autoclose:true, startdate: '+1d', mindate:0, }); $("#start").change( function() { var seconddate = new date($("#st

Python: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters -

i'm using docx module python , mysql, problem today i'm having problem rised affecting row_cells[2].text = a , knowing a retrieved database, problem wasn't exisiting knowing same characters used before using query on duplicate key update , , using %s instead of .format() . the raised error valueerror: strings must xml compatible: unicode or ascii, no null bytes or control characters i tried encode() , encode(a,'utf-8') , have # -*- coding: utf-8 -*- in scripts any please ? edit: when set inserting %s works normal problem format() function? has explanation?

debugging - Android debug confusion -

as far know, debuggers work based on system calls ptrace in linux, block tracee , tracer informations tracee's memory. means, if want use debugger debug main thread in android app process, block main thread , wait operations, may cause main thread anr in few seconds. confused possible debug main thread in android app process , how? correct, adp uses ptrace , blocks main thread , causes application slow down while in debug mode. if step step debugging thread put breakpoint in halted completely. general debugging purposes should not issue. testing how smooth application runs should done in run mode , not in debug mode.

php - wp_get_referer store in session -

i need display text in header if user comes site1.com. have working 1 here current code: <?php $referer = wp_get_referer(); if ( $referer == "http://site1.com" ) { echo '<span class="referrer-display"> <a href="http://site1.com">return site1.com</a> </span></p>'; } else { echo ""; } ?> the problem when user transfer page text removed. believe has session? please enlighten me or point me correct direction achieve want. thank in advance. referer gets removed because when click link, referer not same. referer page on clicked page. can keep referer data inside session preserve value.

android - Signed apk behaving very differently than if the application is run directly on emulator -

i made android application @ end sends object in json format web service , there data goes database. when run application directly on android emulators works , data parsed mobile application database. made signed apk , tested on phone data going database not should. whole database filled 0 values in fields. dont understand why signed apk behaving differently actual code. if has idea problem please me. problem bugging me long time , cant find solution online.

Oracle maven dependency in bitbucket pipelines -

i had requested beta access bitbucket pipelines. got confirmation access today 1 account. enabled pipelines account , tried build 1 project it. project has oracle maven dependency. on system, have oracle dependency installed in local repo build fine. how can install oracle jar pipelines use build ? you cannot download driver until add secure key settings.xml see https://blogs.oracle.com/dev2dev/entry/oracle_maven_repository_instructions_for . how generate key mentioned here https://blogs.oracle.com/dev2dev/entry/how_to_get_oracle_jdbc#settings then can download driver on machine, problem pipelines still here. cannot set password there. realized can use attlassian maven repository jdbc driver v6. me, enough. this pom.xml. <repositories> <repository> <id>atlassian 3rd-party</id> <url>https://maven.atlassian.com/3rdparty/</url> </repository> </repositories> ... <dependencies> <!-- ca

docusignapi - Advantage of DocuSign iOS sdk -

using docusign ios sdk integrated embedded signing app, wanted sdk flexibility customise signing page. real advantage of using sdk? give unique signing url? believe can without sdk using rest apis.can't we? missing something? please let me know how can customise sining page. putting signing url webview , using now. want customisation in page. (see comment above info regarding question using sdk versus api.) depending on how you're wanting customize signing view, may able achieve goals using docusign signing resource file . can find info here .

ios - Implementing UIButtons for selection in Swift -

i'm new ios development , i'm working on fire safety app. give user option of 3 risk levels: low, medium , high using (i suppose) 3 uibuttons user can tap, , ever 1 tap turn colour. i've managed 3 uibuttons working, , can change colour when tapped if tap can't previous button change , i've had difficulties getting value them (for example when submitted if user pressed low use number 2 calculations) to show did quick drawing: button example thanks :) ==== edit ==== i using segmented control instead of uibuttons this. need know how use them in if statement @iboutlet var riskchoice: uisegmentedcontrol! @iboutlet var valuelabel: uilabel! @iboutlet var calcbutton: uibutton! @ibaction func calculate(sender: uibutton) { if (riskchoice.selectedsegmentindex == 0){ valuelabel.text = string("low") } nothing appears in label have set up.. direct me here? you can reset 3 buttons default state when of button tapped , highlight current butt

Prepared statements and class inheritance in PHP -

i have problem when doing prepared statement in php. main goal create 2 classes, first 1 connecting (conexion) server , database , second 1 prepared statements (realizarconsultas). i have decided class used statements should inherit "conexion". doing pretend connect database each time use function "realizarconsultas::mostrarconsulta()". function should connect database, should prepared statement , should close connection. class used connection. <?php class conexion extends pdo{ protected $conexiondb; public function conexion(){ try{ $conexiondb=new pdo ('mysql:host=localhost;dbname=euroburo','root',''); $conexiondb->setattribute(pdo::attr_errmode, pdo::errmode_exception); $conexiondb->exec("set character set utf8"); }catch(exception $e){ echo "error: ".$e->getline(); }

jax rs - StreamingOutput in jax-rs usecases? -

jax-rs provides streamingoutput interface can implement raw streaming of our response bodies. public interface streamingoutput { void write(outputstream output) } i not sure why go building interface expose response outputstream. why not inject outputstream directly , can write on it!! in book restful java jax-rs 2.0 written bill burk (one of resteasy authors), find explanation streamingoutput . the same question asked answered author: streamingoutput simple callback interface implement when want raw streaming of response bodies [...] you allocate implemented instances of interface , return them jax-rs resource methods. when jax-rs runtime ready write response body of message, write() method invoked on streamingoutput instance. [...] you may asking yourself, “why not inject outputstream directly? why have callback object streaming output?” that’s question! reason having callback object gives jax-rs implementation freedom handle output wants

java - Format loss when converting docx to pdf using docx4j-3.2.1 -

Image
i need convert docx pdf , using docx4j-3.2.1 library it. there format loss in generated pdf output. my input docx file and output pdf as can seen there 2 notable issues. 1 size/dimension of image in header reduced in generated pdf. not cover full header area there in input. second font size seem have changed(or perhaps font changed) how can retain dimension of original image on header in generated pdf. there methods can used fine tune conversion of docx pdf. any appreciated. ps : header image taken google image search header demonstration. docx4j v3.2.1 provides "cheap , cheerful" docx pdf output via xsl fo. if not enough you, have 3 options: enhance want use plutext's commercial pdf converter, has own page layout model, designed closely mimic word's, use other product, perhaps libreoffice + jod converter

ruby on rails - Passing instance variables into delayed job -

i'm trying use delayed_jobs (background workers) process incoming email. class emailprocessor def initialize(email) @raw_html = email.raw_html @subject = email.subject end def process @raw_html & @subject end handle_asynchronously :process, :priority => 20 end the problem can't pass instance variables (@raw_html & @subject) delayed jobs. delayed jobs requests save data model retrieved in background task, prefer have background worker complete entire task (including saving record). any thoughts? use delay pass params method want run in background: class emailprocessor def self.process(email) # email end end # somewhere down line: emailprocessor.delay.process(email)

php - How to add forgot pasword rest server api in drupal? -

i working on app uses drupal 7.x rest server api. have service login, logout ex. http://sample.com/xyz/xyz_drupal/rest/user/login post : username:user password:pwd http://sample.com/xyz/xyz_drupal/rest/user/logout now, want create forgot password api new on drupal , no idea how patch works or add new service regular drupal service. please me. http://sample.com/xyz/xyz_drupal/rest/user/reset_password params be: email: xyz@yahoo.com please me start. in advance. i think, should take @ this . services module allows make forgot password request. request type: post resource: ?q=rest/user/request_new_password.json send name or email: foo or foo@bar.com note: may have change resource bit suit project.

Load Dropbox files into JList Maven Java NetBeans? -

i have created maven netbeans project dropbox , need call files in folder dropox , display them in jlist on interface. i able print them out in output using (system.out.println()) following: public void getfiles() { try { mainempoperations mempops = new mainempoperations(); // files , folder metadata dropbox root directory listfolderresult result = client.files().listfolder("/employees"); while (true) { (metadata metadata : result.getentries()) { system.out.println(metadata.getpathlower()); } if (!result.gethasmore()) { break; } result = client.files().listfoldercontinue(result.getcursor()); } } catch (exception e) { joptionpane.showmessagedialog(null, e); } } the coding have tried use loading files jlist

SSIS Lookup data update -

i have created ssis package reads data csv file , loads table1 . other data flow tasks on table 1 .table1 has columns x , y, z, ,b . table 2 has columns , b ,y,z lookup done based on columns y , z . based on column y , z , picking , b table 1 , updating table 2 . problem data gets updated multiple rows of data thats 1 without updation , 1 after updation . i can provide more clear explanation if needed . fleshing out nick's suggestion, rid of second data flow (the 1 table 2 table 2). after first dataflow populates table 1, execute sql task performs update on table 2, , joins table 1 new data. edit in response comment: you need use clause match rows uniquely. apparently model_cd not unique column in jlrmodel_dims . if cannot make clause unique because of relationship between 2 tables, need select either aggregate [length (cm)] min() , max() etc, or need use top 1 , 1 row subquery.

mediawiki - Wikidata query service traverse property -

i trying list of hyperonymes of given wikidata item. instance want traverse "subclass of" element https://www.wikidata.org/wiki/q4421 how sparql command https://query.wikidata.org like? you can use property path (*) syntax. in case wdt:p279* mention 0 or more time wdt:p279 subclass of equivalent in wikidata model. i added few variation here include depth can order them select ?entity ?entitylabel (count(?mid) ?depth) { wd:q4421 wdt:p279* ?mid. ?mid wdt:p279* ?entity service wikibase:label { bd:serviceparam wikibase:language "en" } } group ?entity ?entitylabel order ?depth https://query.wikidata.org/#select%20%3fentity%20%3fentitylabel%20%28count%28%3fmid%29%20as%20%3fdepth%29%20where%20%7b%0a%20%20wd%3aq4421%20wdt%3ap279%2a%20%3fmid.%0a%20%20%3fmid%20wdt%3ap279%2a%20%3fentity%0a%20%20service%20wikibase%3alabel%20%7b%0a%20%20%20%20bd%3aserviceparam%20wikibase%3alanguage%20%22en%22%20.%0a%20%20%20%7d%0a%7d%20group%20by%20%3fentity%20%3fen

swift - Tableview cell button selection error -

i have tableview contains button in left of cell. run works , when select button made change image background. problem when select button buttonone selection , select other buttons when scroll tableview down, other buttons selected code way: func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = self.tableview.dequeuereusablecellwithidentifier("cell", forindexpath: indexpath) as! playercell cell.btnadd.tag = indexpath.row cell.btnadd.addtarget(self, action: #selector(createteamtwo.playeradded(_:)), forcontrolevents: .touchupinside) return cell } func playeradded(sender: uibutton){ // let buttontag = sender.tag sender.setimage(uiimage(named: "btn_buy_minus.png"), forstate: uicontrolstate.normal) } can me please ? take 1 array store selected indexpaths buttons tags. , in selector methods store sender tags , reload tableview. , in cellforrow method ch

entity framework - EF7 Read Master Detail Records -

i'm trying head around ef7 writing simple master-detail relationship sqlite database. saving works fine, reading gives me headaches: here entities: public class message { public int messageid { get; set; } public string name { get; set; } public list<messagepart> messageparts { get; set; } } public class messagepart { public int messagepartid { get; set; } public string text { get; set; } public int messageid { get; set; } public message message { get; set; } } createmessage() supposed to: static void createmessages() { using (var db = new testcontext()) { var m1 = new message { name = "train_arrives_in_x_minutes", messageparts = new list<messagepart>() { new messagepart { text = "train arrives in 5 minutes"

MobileVLCKit iOS Camera roll video "VLC is unable to open the MRL" error -

Image
i have integrated mobilevlckit version: 2.2.2 in ios project. having trouble playing local videos camera roll. videos document directory , streaming working fine though. i using code extract url of phasset object: - (void)urlforphasset:(phasset*)phasset withcompletionblock:(void (^)(nsurl* url))completionblock{ [[phimagemanager defaultmanager] requestavassetforvideo:phasset options:nil resulthandler:^(avasset * _nullable asset, avaudiomix * _nullable audiomix, nsdictionary * _nullable info) { nsurl* url= nil; if([asset iskindofclass:[avurlasset class]]){ url= [(avurlasset *)asset url]; }else if([asset iskindofclass:[avcomposition class]]){ avcompositiontrack* compositiontrack= [[(avcomposition*)asset tracks] firstobject]; avcompositiontracksegment* segment= [[compositiontrack segments] firstobject]; url= [segment sourceurl]; } completionblock(url); }]; } these alerts being shown

rest - How to rename json objects(variables) name in spring boot -

hello new spring boot , json , need in renaming variable name coming in response. consider input "1": { "id": "1", "firstname": "cdgdghirayu", "lastname": "sinfsdgdgghvi", "age": 23 } now in respone need in format "1": { "roll number": "1", "firstname": "cdgdghirayu", "lastname": "sinfsdgdgghvi", "age": 23 } can map "id" "roll number" in way? how achieve in spring-boot? thanks in advance upadte- model class package model; import javax.xml.bind.annotation.xmlrootelement; import com.fasterxml.jackson.annotation.jsonproperty; @xmlrootelement public class person { @jsonproperty("roll number") private string id; private string firstname; private string lastname; private int age; public person() { super(); }

tcl - headers parameters in http::getUrl -

i passing headers parameters in http::geturl -headers {authorization {bearer $token} content-type application/json} but not substituting token value. right creating dict step above, , passing directly -headers $data it way pass value directly, variable substitution occurs this because string in {} not evaluated, have 2 way here. the first using list command: -headers [list \ authorization [list bearer $token] \ content-type application/json ] the second subst command: -headers [subst -nocommands \ {authorization {bearer $token} content-type application/json}] the first method proper used equivalent op example, different expression of list. the purpose of second way, in case have parameter input variable, , not change format in code. notice case subst works on string , not list previous method. it should work same string converted list easy: $ tclsh % set x "a b c d" b c d % lindex $x 0 % as see var

android pre dex errors in Android Studio -

i try open project developed sometime ago android studio , try rebuild , whole load android pre dex errors totally stuck how rid of them. tried lot of stuff such changing android api level, cleaning, change jdk version.. doesn't work. any experts out there can enlighten me cause of these errors.? android pre dex errors screenshot step 1: add multidex enabled in default config defaultconfig { applicationid "your package name" minsdkversion 16 targetsdkversion 23 versioncode 5 versionname '1.0.5' multidexenabled true } step 2 : add library in dependencies compile 'com.android.support:multidex:1.0.0' step 3 : add line in myapplication extends application java class multidex.install(this); step 4: don't forgot call myapplication class in application tag of manifest file. this android:name=".myapplication" after 4 steps clean project , run application. surely helps you! happy coding!

jquery - Refresh table using AJAX in ASP.NET MVC -

i want update table in mvc using ajax. inserted data in database using ajax. want update table after insert new row. ps. tried search nothing helped me, i`m still confused. here code: main page view: <div id="thetable"> @html.partial("_iptable") </div> <script src="~/scripts/jquery-1.10.2.min.js"></script> <script src="~/scripts/admin.js"></script>"` partial page view: <table id="table">` <tr> <th>id</th> <th>line</th> <th>supplier</th> </tr> @foreach (var item in viewbag.iptable)` { <tr> <td> @item.id </td> <td> @item.line </td> <td> @item.supplier </td> </tr> } </table>enter code here

VB.Net Days Between Dates -

i'm trying calculate days have passed between today , date in past using following code: caseopendays.text = (datetime.now.subtract(cdate(datereported.text))) where caseopendays label , datereported.text label. i'm having error thrown: value of type 'system.timespan' cannot converted 'string' what missing here? you have use timespan.days or timespan.totaldays : dim timesincereporting timespan = datetime.now - cdate(datereported.text) caseopendays.text = cint(timesincereporting.totaldays).tostring() another way timespan.tostring : caseopendays.text = timesincereporting.tostring("dd")

android - UIL doesn't support scheme(protocol) from webhost -

i'm getting image webhost. listview not showing image uploaded correct path on database. error uil doesn't support scheme(protocol) default [carkila.esy.es/upload/20160727155302300500.jpeg]. should implement support (baseimagedownloader.getstreamfromothersource(...)) java.lang.unsupportedoperationexception: uil doesn't support scheme(protocol) default [carkila.esy.es/upload/20160727155302300500.jpeg]. should implement support (baseimagedownloader.getstreamfromothersource(...)) @ com.nostra13.universalimageloader.core.download.baseimagedownloader.getstreamfromothersource(baseimagedownloader.java:280) @ com.nostra13.universalimageloader.core.download.baseimagedownloader.getstream(baseimagedownloader.java:99) @ com.nostra13.universalimageloader.core.loadanddisplayimagetask.downloadimage(loadanddisplayimagetask.java:291) @ com.nostra13.universalimageloader.core.loadanddisplayimagetask.trycacheimageondisk(loadanddisplayimagetask.java:274) @ com.nostra13.universalimageloa

Api methods free of Token authentication in Django -

so have implemented token authentication system on django web server following guide tutorial: http://cheng.logdown.com/posts/2015/10/27/how-to-use-django-rest-frameworks-token-based-authentication token needed in every single api call otherwise unauthorised error. need have api calls free, meaning anyone, not registered user(who have token of course) can call it. how done? looking @ article have set authentication scheme on global bases in settings. if want have authentication few select views, must not set globally per view explained here: http://www.django-rest-framework.org/api-guide/authentication/#setting-the-authentication-scheme class exampleview(apiview): authentication_classes = (sessionauthentication, basicauthentication) permission_classes = (isauthenticated,)

Magento Buy x get y free -

i trying create shopping cart rule buy x y free. set buy 3 1 free. if customer changes quantity of item in cart 4 rule applies; however, if same item in cart 4 times, not applying discount. any way of getting working? in advance.

c# - Virtual keyboard opens automatically when closing charms/settings -

my application uses virtual keyboard. keyboard becomes hidden when charms bar opened, reappear when charms bar closed. want control whether reappears or not. my program has several folders editable files, , virtual keyboard used edit files. in charm bar's 'settings' selection i've added control on folders/files displayed. problem occurs when user has virtual keyboard open while editing file, goes charms bar disable folder that file in. i've coded things such file closed when happens, once user closes charms keyboard automatically reopen... , let user keep typing , altering data! can finagle file re-open while folder disabled! i have read several other questions of similar nature, none of them have added element of charm bar. think windows 8 makes note or flags virtual keyboard reopen when open charm bar while keyboard up, , telling keyboard close doesn't touch flag (and anyway can't tell close @ point when it's closed). if can figure out how ha

typescript - Issue with globally visible service in Angular 2 -

i tying make service, visible without importing in component. my bootstrap function: export function main(initialhmrstate?: any): promise<any> { console.log(app_providers); return bootstrap(app, [ ...platform_providers, ...env_providers, ...app_providers ]) .then(decoratecomponentref) .catch(err => console.error(err)); } app providers definition: export * './app.component'; export * './user.state'; export * './app.service'; import { userstate } './user.state'; import { appstate } './app.service'; // application wide providers export const app_providers = [ userstate, appstate ]; and can not call in components constructor constructor( private userstate: userstate ) {} how can fix problem? either importing or using string token or opaquetoken , `@inject() export const app_providers = [ {provide: 'userstate', useclass: userstate}, appstate ]; constructor(@inject(

php - How to format email to an array - Laravel 5.2 -

i need send email notification many users. loop through , users email this: $useremails = $favoriteguides->map(function( $relation ){ return $relation->users->email; }); and result this: collection {#400 ▼ #items: array:3 [▼ 0 => "fake@hotmail.com" 1 => "fake1@hotmail.com" 2 => "fake3@aol.com" .... , on ] } i need format goes array can send mail function. needs formatted this: $emails = ["fake@hotmail.com", "fake2@hotmail.com", "and on..."]; i format result want? i tried - implode - didnt me result wanted. use toarray() method: $useremails->toarray();

windows runtime - SocketActivityTrigger and pushNotifications -

why need check pushnotifications capability, when use socketactivitytrigger? purpose of it? you don't. push notification capability ( id_cap_push_notification ) windows phone 8/8.1 silverlight. both windows runtime 8.1 , uwp (windows 10) not have push notifications capability, see list of capabilities in uwp. if check official sample socketactivitytrigger, you'll see uses capabilities internet connectivity. <capabilities> <capability name="internetclient" /> <capability name="privatenetworkclientserver" /> </capabilities>

javascript - SAPUI5 List Data Binding Array -

i want bind list , content model. var ot = new sap.m.standardlistitem({ title: "{cardatamodel>/cars/1/carid}", }); var olist = new sap.m.list("carlist", { }); olist.binditems('cardatamodel>/cars', ot); i attached following model view: { "cars":[ { "carid":"e7f2b1519ed5", "carname":"one", }, { "carid":"f3ab598a85e0", "carname":"two", } ] } this way list consisting of 2 list items , changing 1 0 can switch between values. want first carid apppear in first item , second in second. tried several syntaxes resulted empty list item. thank you! you referencing absolute path title in template. change relative path (i.e., relative current item in list) instead: var ot = new sap.m.standardlistitem({ title: "{cardatamod

Map all subdomains to another domain with nginx -

with sever config can redirect requests domain: server { server_name example.net; listen [::]:80; listen 80; return 301 https://other.net$request_uri; } but how can redirect subdomains new domain? www.example.net --> www.other.net webmail.example.net --> webmail.other.net forum.example.net --> forum.other.net can use placeholder in return command? use regular expression in server_name : server { server_name ~^(?p<subdomain>.+\.)example\.net$ ; listen [::]:80; listen 80; return 301 https://${subdomain}other.net$request_uri; } please see this answer there few variants on specifying regular expressions in nginx.

How can I get a "Are you sure you want to quit YES/NO" prompt on an access button -

i have quit button in access 2007 called cmdquit - how can have brings warning prompt along lines of sure want quit? yes/no so doesn't automatically quit log form? i have command: private sub cmdquit_click() if msgbox("are sure want close form?", vbyesno) = vbyes exit sub else cancel = true end if end sub so no part of prompt works yes , quit part not thanks dan there nothing cancel, need this: private sub cmdquit_click() if msgbox("are sure want close logger?", vbquestion + vbyesno, praiselogger) = vbyes docmd.quit end sub

java - Deployment onto OpenShift Tomcat 7 is not successful anymore -

we deploy our web spring/hibernate application on openshift tomcat 7.0 our git repository. use free plan. used ok, successful deployment stopped. of time deployment stuck. got following error: webresources [/var/lib/openshift/579937937628e1baed000140/app-root/runtime/repo/src/main/resources/spring] [/var/lib/openshift/579937937628e1baed000140/app-root/runtime/repo/target/rentapp] [info] copying webapp webresources [/var/lib/openshift/579937937628e1baed000140/app-root/runtime/repo/src/main/resources] [/var/lib/openshift/579937937628e1baed000140/app-root/runtime/repo/target/rentapp] [info] copying webapp resources [/var/lib/openshift/579937937628e1baed000140/app-root/runtime/repo/src/main/webapp] [info] webapp assembled in [1119 msecs] [info] building war: /var/lib/openshift/579937937628e1baed000140/app-root/runtime/repo/webapps/root.war [info] web-inf/web.xml added, skipping [info] ------------------------------------------------------------------------ [info] build success

javascript - Programmatically check checkboxes for submission of a webform -

unfortunately there still forms bulk/mass editing not implemented. can annoying, when you've form on 100 records you've update. in case it's around 1000 records , each record has checkbox should checked, unchecked. therefor tried run on-the-fly piece of javascript check boxes me. did show checkmarker @ checkboxes after running javascript. after submission form first unchecked checkboxes - shown checked checkbox - returned there original state (unchecked). the on-the-fly javascript executed firefox's console. var x = document.queryselectorall('input[name^="example"][type="checkbox"]'), = 0; (i = 0; < x.length; i++) { x[i].checked = true; x[i].value = true; // tried 'on' } the initial markup of checkboxes (manually) checked , unchecked: <input name="example[1]" checked="" type="checkbox"> <input name="example[2]" type="checkbox"> as far know checked

mysql - Selecting multiple values from same column with a single Select query -

so, i've got 2 tables: users , tasks; users: user_id username password first_name last_name isadmin tasks: task_id name description assessment assigned_user_id fk creator_id fk created_on last_modified status what want replace assigned_user_id , creator_id first_name + last_name users table. execute following query: select `task_id`, `description`,`assessment`, (select concat(`first_name`, ' ',`last_name`) `tasks`.`assigned_user_id` = `users`.`user_id`) assigned_user, (select concat(`first_name`, ' ',`last_name`) `tasks`.`creator_id`=`users`.`user_id`) creator_user, `created_on`,`last_modified`,`status` `tasks` left join `users` on tasks.assigned_user_id = users.user_id or tasks.creator_id = users.user_id task_id=2 the problem returns 2 rows. 1 assigned_user_id null , filled creator_id , other other way around: task_id description assessment assigned_user creator_user created_on last_modified

javascript - Selecting a generated id with jQuery -

i have html element this: <div id="myelement_9082173219731721923"> i want add class element select css. loaded after other stuff on site, because it´s generated external javascript. that´s why tried: $('[id^="myelement_"]').load(function() { alert("im here"); $('[id^="myelement_"]').addclass('myclass'); }); but doesn´t reach alert. doing wrong? thanks this should work, load on div element never happen. use dom change listener instead. , don't need quotes around id selector. not wrong, not must have. $("body").on("domsubtreemodified", function() { $('[id^="myelement_"]').addclass('myclass'); }); working example. you should change body smallest selector of dom, div#myelement_ appear. , if happens 1 time, change on one . listener disables , not run on changes.

How do I multiply a map of a variable in Python? -

here's code: elif cmd == "pay dog": name = input("dog name? ") d in dogs: if d["name"] == name: print(d["name"] + " owes $" + d["days"]) how multiply d["days"] person has pay $30 each day? mean is, how multiply d["days"] 30? as see, d["days"] string. try this: print(d["name"] + " owes $" + str(30 * int(d["days"]))) or this: print("%s owes $%d" % (d["name"], (30 * int(d["days"]))))

How to split multivalue parameter that is already contains comma in ssrs reports -

Image
i have ssrs report multivalue parameters jobtitle . jobtitle contains ','. so, how split multivalue parameter? for example, have records : responder,supervisor,field distributor 1,worker,field distributor i want: responder supervisor,field distributor 1 worker,field distributor i assuming want split @ each comma. used expression =fields!jobtitle.value.tostring().replace(",",vbcrlf) to this

how to put a file in a folder in Visual Studio with cmake -

Image
with cmake, can put several targets in user-defined folder within visual studio project. example: this can down source_group command of cmake. here question: how can put file within folder. in thisexample, how can put readme.txt insider modules folder, , make parallel targets such opencv_core? thanks.

c++ - Cannot compile python packages using C. Error 2 - Cannot open include file: 'alloca.h'? -

it started "unable find vcvarsall.bat" fixed pretty quickly. after cannot fix "error 2". already tried instructions here , here : installed visual c++ compiler python 2.7 installed microsoft visual studio 2008 express edition sp1 installed windows sdk windows 7 , .net framework 3.5 sp1 manipulated vcvarsall.bat , vsvars64 but still cannot install pyethash, pyyaml, scrypt. details pyethash below. tried install crypto, uses c++ libraries - , works. still looks have problems compilers or should somewhere else? using windows 8.1 x64, python 2.7.11 (v2.7.11:6d1b6a68f775, dec 5 2015, 20:40:30) [msc v.1500 64 bit (amd64)] installing pip ps c:\pyethereum\ethash-master> pip install pyethash collecting pyethash using cached pyethash-0.1.27.tar.gz building wheels collected packages: pyethash running setup.py bdist_wheel pyethash ... error complete output command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\u