Posts

Showing posts from June, 2010

sql - join one table if condition met otherwise from another table -

i want know sql query following condition i have 3 tables, table 1 want data, second table1mapping , third master table. i want data table1mapping if related data exists otherwise master table , table 1 . table 1 common. for example: table 1: id name 1 abc table1mapping: table1id country code 1 958 2 ind 89 master country code uk 87 56 ind 45 user can select multiple countries. if selects , ind code should table1mapping , ind should master there no data id 1 , us. code may different in both tables. you didn't provide schema created fantasy data show how can like. description: use 2 left joins in combination coalesce, give first element not null. declare @tab1 table ( id int ) declare @tabmapping table ( id int, anycol varchar(100) ) declare @tabmaster table ( id int, anycol varchar(100) ) insert @tab1 (id) values (1),(2),(3),(4),(5),(...

Adding cms block to footer links magento -

how can add cms static block footer footer links , view on specific store view ? using magento 1.9 creating static block: go magento admin panel , select cms -> static blocks then click on “add new block” button right top now fill following fields: block title: give name of static block here. not show on frontend identifier: give id of block. used reference of block, when adding template file or cms page status: define visibility of static block on frontend content: content of static block can plain text, html code , javascript. click on “save block” button. showing static block in frontend @ footer: go app > design > frontend > your_package > your_theme > layout. open appropriate file, lets page.xml , add following code inside <block type="page/html_footer name="footer" as="footer" template="page/html/footer.phtml""> block: <block type="cms/block" name="your_block_id" be...

iphone - How to add survey monkey ios sdk inside my ios application? -

how integrate surveymonkey ios sdk inside ios app? viewcontroller.h have tried following code in project; #import <uikit/uikit.h> #import <surveymonkeyiossdk/surveymonkeyiossdk.h> @interface viewcontroller : uiviewcontroller @property (nonatomic, strong) smfeedbackviewcontroller * feedbackcontroller; @end viewcontroller.m #import "viewcontroller.h" //static nsstring *sample_survey_hash=@"e7bvbydjgchg6vyr2qyrzxkq"; //#define sample_survey_hash @"43w3ikqgkvjcvrlvko8bxt_2frxe_2bvhergqp5w2r5tc2c_3d" #define feedback_question_id @"813797519" #define feedback_five_stars_row_id @"9082377273" #define feedback_four_stars_row_id @"9082377274" #define sample_app @"survey_sample" #define survey_hash @"lbqk27g" #define app_id @"dh9k6dy" @interface viewcontroller () <smfeedbackdelegate, uialertviewdelegate> @property (weak, nonatomic) iboutlet uibutton *takesurveybutton; @propert...

File upload in Mobile Safari -

which file types applicable upload in mobile safari using html file input? i've tried jpg, png, bmp, gif, tif, tiff , works, i'd have complete list of files. the developer documentation not list restrictions, you're safe assume there aren't any: file uploads , downloads safari on ios supports file uploading—that is, <input type="file"> elements—on ios 6 , later. note in ios 6 8 you're limited photo library anyway, what's in there works. in ios 9 there's new file upload dialog, apparently allows uploads various cloud storage services expands scope of file uploads in mobile safari significantly.

php - SEARCHING with some condition in codeigniter -

i have web project using codeigniter. have problem searching in project. have show multiple result searching page keyword. here model function find_user($like){ $this->db->from('user'); $this->db->like('name', $like,'after'); $result =$this->db->get(); return $result->result_array(); } and in user table, include id | name | place_code in user table , column place_code use show place user here controller function search(){ $query = $this->input->post('query_cari'); $find = $this->m_user->find_user($query); foreach ($find $key) { $code = $key['place_code']; if ($code == '1') { $place = 'secretray'; }elseif($code == '2'){ $place = 'ob'; }elseif($code == '3'){ $place ='manager'; } } $data['result'] = $find; $data['place'] ...

retrofit - Android App not connecting to network which is on **localhost** and if trying to run on Real Mobile Phone -

Image
i have created 1 android app communicate restful webservice using retrofit .it performing when running on **genymotion **,means sending request , getting respond back. but when run on real mobile phone ,app running not sending request also.can tell me why happening ? afteredit: when have gson gson = new gsonbuilder() .setfieldnamingpolicy(fieldnamingpolicy.lower_case_with_underscores).create(); restadapter restadapter = new restadapter.builder() .setendpoint("http://10.0.3.2:8082") .setconverter(new gsonconverter(gson)) .build(); retrofitservice service = restadapter.create(retrofitservice.class); try { serverresponse serverresponse = service.checklogin(logindetails); ...} where retrofit interface public interface retrofitservice { @headers({ "content-type: application/json" }) @post("/vendorwebapplication/userlogin") public serverresponse checklogin(@body logind...

Issue document to open in edit mode using lotus Notes Cilent -

this link using open document in edit mode , document opening in read mode. check there no issue author field.so can suggest me issue might be. notes://cb10dev@cbob/__85257c2f005410fe.nsf/0/8c2f729af16f74dd85257c85007860b0?editdocument

c++ - Incorrect OpenGL winding -

Image
when initializing opengl, set following: glenable(gl_cull_face); glfrontface(gl_ccw); glcullface(gl_front); then, draw triangle on screen. that's do, really. opengl uses opposite winding type of specify using glfrontface . the triangle vertices defined follows: static glfloat triangle[] = { 0.0f, 0.5f, 0.0f, // point 1 on image -0.5f, -0.5f, 0.0f, // point 2 0.5f, -0.5f, 0.0f, // point 3 }; you can see results on following image: what expect gl_ccw draws triangle , cl_cw doesn't. happens opposite. my perspective , view matrices correct. cause problem? glcullface specifies side gets culled away , not side drawn. when triangle given in ccw order , enable way do, front faces (ccw faces) culled away , nothing drawn.

Cakephp: iterate through pages in a custom view -

i have view several megabytes of data , expect grow radically. controller index function implemented in default way, pagination. export view csv without making changes controller ( i'm fine define header rows , rows included in csv not remove pagination brakes html representation ). the idea simple: render csv view template, change page, render one. how can change current pagination settings in custom view? ps: did take @ csv plugin . doesn't work pagination out of memory limits, creates tmp file, prefer stream content on fly. i wouldn't use paginator here, total amount of records while() loop , fetch data in batches avoid memory limitations. , send comes db directly client. use http client comes cakephp , set proper header properties. see these 2 answers how send stream: send file client php: stream remote pdf client browser streaming large file using php

linux - disk space limitation when creating war file -

i have 1 gb disk space limitation hosting app , have used 700mb of it. however want create war file directory big (around 600mb) using command : jar -cvf root.war folderpath that's why encounter quota limitation , can't following. i'm looking way delete folder content when it's applying archive conserve disk space take note can't install zip tool in ssh shell ~ the code works on test directories, test first anyway, deletes files. it's not efficient. assumptions: 300mb free space, in destructively compress 600mb folderpath directory. none of files big -- if file in folderpath 300mb or larger, fail. notes: if ' $out ' file exists, nothing. first find pipes file list while , if ' $out ' doesn't exist in loop, create it, don't update -- if does exist, update it. each pass adds 1 more file, deletes unless file directory. after loop finishes delete empty directories too. unset u ; in=folderpath ; out=roo...

php - Replace username part in email addresses into asterisks -

how can convert username in email addresses asterisks. first , last letter in username stay , rest replaced (*). example: mhyunf@gmail.com into m****f@gmail.com you can using arounds. /(?!^).(?=[^@]+@)/ (?!^) negative behind. checks if character not preceded start of string. ensures first character not selected. . matches single character. (?=[^@]+@) positive ahead. ensures single character matched followed other @ ( ensured [^@] ) , @ regex demo example preg_replace("/(?!^).(?=[^@]+@)/", "*", "mhyunf@gmail.com") => m****f@gmail.com

javascript - setTimeout doesn't work on next call -

i'm using settimeout display bootstrap3 progress bar. works first time display when press submit. when press submit again, progress bar doesn't start 0 i've tried ensure using settimeout . i'm using following javascript code: $(document).ready(function() { $("#name-form").submit(function(event) { event.preventdefault(); $(".progress").css("display", "block"); $(".progress-bar").css("width", "0%"); settimeout(function() { $(".progress-bar").css("width", "70%"); }, 10000); var $form = $(this), url = $form.attr('action'); settimeout(function() { $(".progress-bar").css("width", "100%"); $('#message-heading').append("welcome"); }, 2000); }); }); why happening? <!doctype html> <html lang="en"> <head> <meta...

c# - SignalR/EPiServer "/signalr/hubs?" 404 on IIS when trying to use Live Monitor -

Image
i'm trying live monitor episerver work. however, when page loads,it returns 302 on /signalr/hubs? , redirect our 404 page. see screenshot: this startup class: using microsoft.owin; using owin; [assembly: owinstartup(typeof(mywebapp.web.plumbing.owinstartup))] namespace mywebapp.web.plumbing { public class owinstartup { public void configuration(iappbuilder app) { app.mapsignalr(); } } } i have installed these nuget packages: microsoft.owin microsoft.owin.security microsoft.aspnet.signalr.core microsoft.aspnet.signalr.systemweb episerver.livemonitor i don't have experience working this; can help? i did reinstall of episerver.livemonitor package, pulled dependecies, including signalr . after set live monitor again, , tried load page. still got same result, time totally emptying asp.net cache worked, oppsed last time.

c# - Entity Framework with Include and Select together -

i have following entities ( pseudo code save space) program [ int id, string name, list<programfoodtype> programfoodtypes, list<programfood> programfoods] programfoodtype[ int id, int programid, int type, bool isactive] programfood [ int id, int programid, food food, foodtype foodtype] food [int id, string name] foodtype [int id, string name] my task single program related programfoodtypes condition programfoodtype should active , programfoods related entities food , foodtype i used following far 1- below query retrieve details of programfoodtypes , programfoods bring active , inactive programfoodtypes var program = mentities.programs .include(p =>p.programfoodtypes) .include(p =>p.programfoods.select(f =>f.food)) .include(p =>p.programfoods.select( f =>f.foodtype)) .where(m =>m.id== id); 2- below q...

fiware - "null" name is given to both folder and file when sinking data from Orion to Cosmos using Cygnus -

i have issue related ngsi2cosmos data flow. works fine when persisting information received in orion public instance of cosmos, destination folder , file name both "null". simple test follows: i create of brand new ngsientity these headers added: fiware-service: myservice & fiware-servicepath: /my i add new subscription cygnus reference endpoint. i send update created ngsientity when check user space in cosmos check following route has been created: /user/myuser/myservice/null/null.txt file content ok, every updated info in orion has been correctly sinked it. problem folder , file names. can't make work properly. isn't supposed entityid , entitytype folder , file naming? component versions: orion version: contextbroker-0.19.0-1.x86_64 cygnus version: cygnus-0.5-91.g3eb100e.x86_64 cosmos: global instance cygnus conf file: cygnusagent.sources = http-source cygnusagent.sinks = hdfs-sink cygnusagent.channels = hdfs-channel #=============...

cmd - php is not recognized as an internal or external command in command prompt -

i got following error when run command php c:\xampp\htdocs>php 'php' not recognized internal or external command, operable program or batch file. i don't error when run command php in following path: c:\xampp\php>php //do not got error here why error? 'php' not recognized internal or external command, operable program or batch file. add c:\xampp\php path environment variable. close command prompt , restart again. it's important because if didn't restart command prompt changes not reflected. thanks

asp.net - Specify which config transform to use for continuous deployment to Azure web app -

is there way specify config transform should applied when deploying azure web app through continuous integration (i.e. not through publish in visual studio)? we have continuous integration set github, seems web.release.config transform applied on deployment. we prefer have custom transform name, e.g. web.azure.config . is deployment slots used this? , if so, only way it? thanks! ps. question belong on serverfault? think it's more related programming? ds. the environment name can set specific azure web app adding application setting, in azure portal, called scm_build_args value of -p:environment myazuresite this set environment name, resulting in config transform named web.myazuresite.config applied during build. more information here

sql - ORA-01799: a column may not be outer-joined to a subquery -

hi people please find code below running in db2 fails in oracle. select * (select distinct e.time_stamp,e.applicationid, e.processname, e.stage, e.initiatingsource, e.status, e.start_time, i.consultant, g.cifnumber, g.applicantfirstname, g.applicantlastname, case when e.branch not null e.branch else case when g.branch not null g.branch else i.branch end end branch (select c.time_stamp, b.applicationid, b.processname, b.stage, b.branch, b.initiatingsource, case when d.status null c.status else d.status end status, c.time_stamp start_time, case when d.time_stamp not null d.time_stamp else current_timestamp ens end_time (select distinct f.applicationid, f.branch, f.initiatingsource, f.processname, case when f.stage in ('start''end') 'application' els...

vb.net - external image in RDLC report -

i'm trying use external image on report in application. it's windows application form. the property enableexternalimages of localreport true source of image external value i'm trying this. file:///c:\image.png i can see image on report visual studio designer, when run application can't see image on report red x. what can do? update tried same on different computer , works good. problem laptop. idea? maybe permission problem? try laptop, put image in different location permission not needed in documents folder , see if issue still same.

javascript - limit records in mongodb query -

this question has answer here: retrieve queried element in object array in mongodb collection 10 answers this document in mongodb , need limit output: { "_id": objectid("55880fb8c3addd201ee2f70e"), "title": "sales", "level1": [{ "name": "master", "link": "/sales/master" }, { "name": "ecommerce", "link": "/sales/ecommerce" }] } my search query is: db.collection.find({ title: "sales", "level1.name": "master" }, { "title": 1, "level1.name": 1, "level1.name": "master" }) this expected output: { "_id": objectid("55880fb8c3addd201ee2f70e"), "title": "sales", ...

html - Javascript - Find all occurences of brackets in a string and replace the content depending on it's content -

i want search occurrences of url() in string , replace content on basis of it's content. so example there are these different url-contents: url("assets/images/pic.jpg") url('assets/images/pic.jpg') url("../images/pic.jpg") url(../images/pic.jpg) url('../images/pic.jpg') url('http://website.com/images/pic.jpg') and link should inserted in front of url, depending on content: link = "file://dir/first/" if there ../ in front url, should removed , link should in front of it. and if there http:// in front, of http-link should removed, except fil @ end , link should inserted in front: so following link should transformed to: url('http://website.com/images/pic.jpg') url("file://dir/first/pic.jpg") the problem is, link in between " , ' or nothing. i know how replace ../-things response=response.replace(/url\(\'\.\.\//g, "url('"+link); response=response.replace(/ur...

Django’s admindocs: Abstract models not shown -

how register abstract models in django admin docs? example: class usercontent(models.model): """all user content must inherit model""" date_created = models.datetimefield(default=timezone.now) published = models.booleanfield(default=true) moderated = models.booleanfield(default=true) class meta: abstract = true

html5 - Bad value cache-control for attribute http-equiv on element meta -

i dont want html5 pages cached , using these tags under html file <!doctype html> <head> <meta charset="utf-8"> <meta http-equiv="cache-control" content="max-age=0" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="expires" content="0" /> <meta http-equiv="expires" content="tue, 01 jan 1980 1:00:00 gmt" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="x-ua-compatible" content="ie=edge"> <script src="js/jquery-1.10.2.min.js"></script> </head> when validated these http://validator.w3.org/check , its saying bad value cache-control attribute http-equiv on element meta. <meta http-equiv="cache-control" content="max-age=0" /> bad value cache-control attribute http-equiv on element meta. <me...

zend framework2 - How to disable a view in ZF2 without losing the style? -

how disable view in zf2 without disabling style ? when did : $datas = $query->getresult(); $result = new viewmodel(array( 'datas' => $datas )); $result->setterminal(true); return $result; i got data lost style ... thanks. like tim in comment said: layout contains styling. what manually echo helper in view. echo $this->headlink(); for example.

python - Filter coordinates in a given range -

i've got hundreds of .out files geographical positions, bulk import sqlite database. however, save time, import line geographical coordinates inside intervals. the file this: value;value;longitude;latitude;value;value value;value;longitude;latitude;value;value so isn't inside several latitude, , longitude intervals should deleted file. for f in *.out each line in $f: if not longitude >= longitude1 , longitude <= longitude2 or longitude >= longitude3 , longitude <= longitude4 or longitude>=longitude5 , longitude<=4: delete line i have included pseudocode show effort, how in bash, awk, python or ever method fastest. the longitude , latitude third , fourth value here. have 21 latitude intervals, f.ex 69.41 70.95 (latitude). example input 63;543534;34,12;59,43;22,80;654,324;139543; 63;25725;5,11;59,43;22,80;36,00;1391212800; 61;5382189;3,66;60,93;68,00;158,00;1391212800; 43;25977000;10,72;67,51;170,70;168,00;1391212800; ...

r - How can I sort a vector based on the indices contained in a different vector? -

i have vector sort based on indices contained in vector. instance, if have these vectors: x <- c(0.4, 0.8, 0.1, 0.2) #<--values sorted y <- c(3,1,4,2)# <--indices base sorting vector y have distinct values 1 length of x (and therefore, both vectors have same number of elements) the expected vector be: 0.8,0.2,0.4,0.1 or use order x[order(y)] ## [1] 0.8 0.2 0.4 0.1

php - Insert RSS Feeds as WP posts -

how retrieve feed & insert using wp_insert_post(); interested if function can able pick 2 feeds each feed unique source. if able code php easy loop through rss feed , insert data wordpress. create new post type (though of course can use default 'post' type). in example below using post type made called 'article'. there many ways loop through rss feed, here use: $rss = new domdocument(); $rss->load($rss_url); // loop through each item in feed foreach ($rss->getelementsbytagname('item') $node) { // code goes here // example value // define namespace $ns = 'http://purl.org/rss/1.0/modules/content/'; $content = $node->getelementsbytagnamens($ns, 'encoded'); $content = $content->item(0)->nodevalue; } in loop through rss feed data , save variables, run following: $new_article = array( 'post_title' => $title, 'post_content' => $content, 'post_excerpt' =...

Conditional binary variable logic in gams model -

this model in gams, i have binary variable (b(n)) , real variable (u(n)), n set. want binary variable equal 0 when u zero, , equal 1 when u isn't zero. this easy if use 'if' statements can't use them in model equations, needs done math logic... it's ok! found solution: b(n) =l= rel_ne(u(n),0) b(n) =g= rel_ne(u(n),0) this seams working fine. it's not elegant solution whatever. rel_ne returns 1 if u(n) not equal 0, , returns 0 otherwise.

promise - Download an image using node-request, and fs Promisified, with no pipe in Node.js -

i have been struggling succeed in downloading image without piping fs. here's have accomplished: var promise = require('bluebird'), fs = promise.promisifyall(require('fs')), requestasync = promise.promisify(require('request')); function downloadimage(uri, filename){ return requestasync(uri) .spread(function (response, body) { if (response.statuscode != 200) return promise.resolve(); return fs.writefileasync(filename, body); }) .then(function () { ... }) // ... } a valid input might be: downloadimage('http://goo.gl/5filfb', 'c:\\thanks.jpg'); i believe problem handling of body . have tried casting buffer ( new buffer(body, 'binary') etc.) in several encodings, failed. thanks ahead help! you have tell request data binary: requestasync(uri, { encoding : null }) documented here : encoding - encoding used on setencoding of response data....

c# - How can I insert a row from datagridview to Database -

is there way insert row datagridview database in winforms ? this how create gridview: this.datagridview1.allowusertoaddrows = true; this.datagridview1.allowusertodeleterows = true; var query = fe in tm.rdp0 select fe; testlist = query.tolist(); datagridview1.datasource = testlist.tolist(); this how add new row datagridview rdp0 newrow = new rdp0(); newrow.no = 1 + datagridview1.rows.count; newrow.custid = 1000 + datagridview1.rows.count; testlist.add(newrow); datagridview1.datasource = null; datagridview1.datasource = testlist; after filled newly created empty row on datagridview want insert database. tm.savechanges(); because savechanges() -above- doesnt work. any appreciated. no more need help. found solution. int index = datagridview1.rows.count; rdp0 newefes = new efesrdp0(); newefes.no = convert.toint32(datagridview1.currentro...

twitter bootstrap - loading website doesnt work is there something missing -

i've bootstrap template, , starting alter typing on (not css or html tags), , thought load on hosting area, 1and1.co.uk , doesn't. it appears have taken html , not css, despite loading ordinary css other version in css.min etc , other 1 template. i've loaded js , fonts etc there no reason why shouldn't load. there obvious missing?

c# - unwanted culture specific dlls copied to bin directory -

i using visual studio 2013 & fluent validation 5.6.2 i see after build in bin folder copies culture specific fluentvalidation.resources.dll seems mentioned in .nuspec file > <file src="lib\net35\de\fluentvalidation.resources.dll" > target="lib\net35\de\fluentvalidation.resources.dll" /> > <file src="lib\net35\es\fluentvalidation.resources.dll" target="lib\net35\es\fluentvalidation.resources.dll" /> > <file src="lib\net35\fr\fluentvalidation.resources.dll" target="lib\net35\fr\fluentvalidation.resources.dll" /> > <file src="lib\net35\it\fluentvalidation.resources.dll" target="lib\net35\it\fluentvalidation.resources.dll" /> > <file src="lib\net35\nl\fluentvalidation.resources.dll" target="lib\net35\nl\fluentvalidation.resources.dll" /> > <file src="lib\net35\pt\fluentvalidation.resources.dll"...

c# - Search through XML and grab another Node -

<?xml version="1.0" encoding="utf-8"?> <envelope xmlns:xsd="http://www.w3.org/2001/xmlschema"> <message> <messageid>1</messageid> <product> <sku>33333-01</sku> </product> </message> </envelope> i've tried googling whether i'm not providing correct search criteria don't know. i want able search xml file based on messageid , grab sku. i want search xml file based on sku , remove message completely. <?xml version="1.0" encoding="utf-8"?> <envelope xmlns:xsd="http://www.w3.org/2001/xmlschema"> <message> <messageid>1</messageid> <inventory> <sku>33333-01</sku> <quantity>1</quantity> </inventory> </message> <message> <messageid>2</messageid> <inventory> ...

javascript - Angular js: Creating Boostrap modal Windows template: Trouble to define action for ng-click in button -

i trying create template modal windows in app. goal set different parameters applied modal windows using dedicated object: $scope.modalwarning = { titre: "", texte: "", type: "", bouton1valid: true, bouton1libelle: "", bouton1action: "", bouton2valid: false, bouton2libelle: "", bouton2action: "" } my template : <div class="modal fade" id="modalwarning" tabindex="-1" role="dialog" aria-labelledby="examplemodallabel"> <div class="modal-dialog" role="document"> <div class="panel panel-{{modalwarning.type}}"> <div class="panel-heading"> <h2>{{modalwarning.titre}}</h2> </div> <div class="panel-body"> {{modalwarni...

Pentaho Mondrian using aggregate tables -

Image
i have xml schema description pentaho mondrian. looks this: <dimension foreignkey="dt" name="dt" type="timedimension"> <hierarchy allmembername="all" hasall="true" name="hierarchy" primarykey="dt" visible="true"> <view alias="dt_view"> <sql dialect="generic">select distinct "dt",date_part('year', "dt")::integer year, date_part('month', "dt")::integer month, date_part('day', "dt")::integer day "world_steel_production"."world_steel_production_data" </sql> </view> <level captioncolumn="year" column="year" hidememberif="never" leveltype="timeyears" name="years" type="integer" uniquemembers="false"/> <level column="month" formatter="...

vbscript - Hard delete Exchange rules via vbs -

i trying remove oof-rules exchange. following vbs script set objsession = createobject("mapi.session") objsession.logon "", "", false, false, 0, true, server & vblf & mailbox set objinbox = objsession.inbox set objhidden = objinbox.hiddenmessages i= 1 objhidden.count set objrule = objhidden.item(i) ...validation if item oof-rule... objrule .item(i).delete this works fine rules. however, in cases, receive error in last line: "mapi_w_partial_completion(40680)" i tried same in mfcmapi , received same error message there when deleting rule. however, if chose "permanent delete passing delete_hard_delete", works fine... so question is: how can pass delete_hard_delete flag in vbs? possible? as alternative, use programming language and/or redemption update: works redemption... looks redemption passes flag default. vbs-code: const olfolderinbox = 6 set session = createobject("redemption.rdosession") sessio...

Applying Kendo button K-state-disabled class removing functionality of button -

if(data[keyvar]==false) { jquery('#btnsaveajax').prop("disabled", false).removeclass("k-state-disabled"); } after execute statement function present on save button not getting called. need add or remove more classes function back? i want try answer question first grasp question is i have grid.. , edit have popup window.. on there 2 buttons.. edit , save.. have 2 view modes.. edit , view.. in edit mode save button disabled , in view mode save button disabled.. so when click "the button" here think refers edit button want save button enable. far i've got, first when click view details see save button disabled while edit button enabled, then when click edit button save button enabled demo

sed - shell script, how to escape variables? -

i writing shell script input value , want use value other commands. problem want escape value. for example, if input http://example.com in following script echo "input value my_value" read my_value echo $my_value it result in http://example.com but result wish http\:\/\/example\.com how achieve this? command i'm trying run is sed -i s/url/$my_value/g somefile.html without escape becomes sed -i s/url/http://example.com/g somefile.html syntax error.. you can use other characters split s arguments. , sed -i 's,url,http://example.com,g' . if want can use sed replace / in argument, before executing url=$(echo "http://example.com"|sed 's,/,\\/,g') sed -i 's/url/'"$url"'/g' input

cordova - How to dynamically set click event in jquery mobile inside a for loop -

here problem. want dynamically generate <li></li> elements inside loop. click events, invoke function called showlessonlist(), , want pass 1 parameter loop iterator value(value of index) ,how can ? beginner, kindly me,thanks in advance. my code here for (var index = 0; index < coursedata.subjects.length; index++) { var li = document.createelement('li'); li.setattribute("data-tab", "1"); li.setattribute("vclick",'showlesssonlist('+ index +')'); li.innerhtml = coursedata.subjects[index].title; $('#subjectlisttabs').append(li); } i want invoke showlessonlist() respective index value taking parameter when click or tap on <li> element generated inside loop i developing mobile app cordova , kindly suggest me event should use vclick or click , tap, onclick . , kindly show way dynamically set these event inside loop respective index value take func...

java - Why when I unit test do I get coverage points with `final lazy val` but not `final val`? -

Image
i have code (project source available here - https://github.com/natemurthy/testing-final-vals ): object main extends app { final val name = "foo" } and i'm using scalatest , sbt coverage plugin test code so: import org.scalatest.{flatspec,matchers} class maintest extends flatspec matchers { should "have name" in { main.name shouldbe "foo" } } but reason coverage points when include lazy modifier in expression: why case? my guess coverage tool counts executed lines. final val name = "foo" is compiled constant inline value in bytecode private static final in java. when accessing variable read value bytecode constant. more info on inlining constant values during compiling final lazy val name = "foo" on other hand compiles lazy construction method since there no lazy values in jvm. if access variable lazy construction method executed. more info on scala lazy value bytecode generation

php - TWIG Random Command - On Reload -

i'm quite new php/twig, have been trying use twig 'random' command, example following: {{ random(['apple', 'orange', 'citrus']) }} {# example output: orange #} it works first time when save file, i'd work every time reload page; seems create new random option when re-save file. this function works right, if number of options small (like 3 options of official example) it's common see 1 value again , again. try add more values , you'll see different value each time. another issue might happening page cached , therefore, see first selected result until reload page. twig cache doesn't affect random() function, http cache or other php cache may affect it.

spagobi - Not able to view the datasets while creating the charts -

i'm able create dataset , view in list of datasets. but, while creating charts i'm not able select dataset in document details page. it's showing "server refused connection". can 1 in resolving issue? thanks: ravi i had same issue , asked contact email. answer: maybe due mistake on spagobi_host_url config: see http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/dataviz_- spagobi -_installation_and_administration_guide#installation_from_released_package details. so changed spagobi_host_url in conf/server.xml file server ip address instead of localhost , problem fixed. hope helps you.

ios - CGContextRotateCTM not working for rotating a UIImage -

i want draw delete button delete app button on home screen below code. the idea draw cross first, , rotate 45 degree. what's wrong code? self.deletebutton = [[uibutton alloc] initwithframe:cgrectmake(0, 0, badge_size, badge_size)]; if (!deletebtnimg) { cgrect imgframe = self.deletebutton.bounds; uigraphicsbeginimagecontextwithoptions(imgframe.size, no, 0.0); cgcontextref context = uigraphicsgetcurrentcontext(); cgcontextsavegstate(context); cgfloat size = min(imgframe.size.width, imgframe.size.height); uibezierpath *path = [uibezierpath bezierpathwitharccenter:cgpointmake(imgframe.size.width/2, imgframe.size.height/2) radius:size/2-radius_margin startangle:0 endangle:m_pi * 2 clockwise:yes]; [path movetopoint:cgpointmake(size / 2, ...

OOP Javascript vs object literal -

i find myself use oop, mean this function person(name){ return this.name = name; } person.prototype.dateofbirth = function(){ //some stuff here } var john = new person('john'); console.log(john.dateofbirth); maybe i'm not building framework or whatever sometime group method using object literal instead like var john = { name:'john', dateofbirth: function(){ // return etc } } john.dateofbirth(); maybe because js client side language oop quite redundant, can u guys share ur oop experience using js? learned basic prototypical inheritance , advance objects of js haven't find use case it. check out revealing module pattern, in have control on what's exposed , what's not. think gives public/privacy control 1 wish in oop. this blog post example var person = (function() { var name = "default"; function dateofbirth() { privatebirthcalculation(); //can invoked inside of scope console.log( ...

javascript - How to let the current type status of the customer show in the drop-down menu -

here select box/drop-down menu: var type_select = '<select id="type_select" style="margin-bottom:0px;">'; var i; var customer_group = <?php echo json_encode($customer_group);?>; (i = 0; < customer_group.length; ++i) { //console.log(customer_group[i].group_id); if (customer_group[i].group_name == table_column_3){ type_select = type_select+'<option value='+customer_group[i].group_id+' selected="selected">'+customer_group[i].group_name+'</option>'; }else{ type_select = type_select+'<option value='+customer_group[i].group_id+'>'+customer_group[i].group_name+'</option>'; } } type_select = type_select+'</select>'; modal dialog box: bootbox.dialog({ onescape:true, backdrop:true, messag...

html - Ionic Framework responsive table with data attribute not working as expected -

Image
i trying achieve responsive table mobile using ionic framework. using example here (codepen) of codes below too html <table> <thead> <tr> <th>payment</th> <th>issue date</th> <th>amount</th> <th>period</th> </tr> </thead> <tbody> <tr> <td data-label="payment">payment #1</td> <td data-label="issue date">02/01/2015</td> <td data-label="amount">$2,311</td> <td data-label="period">01/01/2015 - 01/31/2015</td> </tr> <tr> <td data-label="payment">payment #2</td> <td data-label="issue date">03/01/2015</td> <td data-label="amount">$3,211</td> ...

node.js - how to run a fuction in series NODEJS -

i using async waterfall model execute functions in sequence. however, within each function not execute statement in series. instance below var serviceconfig = loadcsv(); callback(null, serviceconfig); i want callback execute when loadcsv() function returns value looks continue execution apiroutes.get('/api/:service/:subject', function(req, res) { async.waterfall([ function(callback){ var serviceconfig = loadcsv(); callback(null, serviceconfig); }, function(serviceconfig, callback){ console.log("serviceconfig final: " + serviceconfig); callback(null, 'd'); }, function(argd, callback){ }], function (err, result) { } ) }); you could, if possible you, send callback loadcsv, , let handle it. var serviceconfig = loadcsv(callback); and in loadcsv: function loadcsv(callback) { // code callback(null, result); }

java - NoClassDefFoundError ClassLoader -

im getting error on thie line loadedclass = classloader.loadclass("scripts.compass"); somehow file compiles fine when try load class wont work because says missing class com/deft/core/scripts/deftscript compiling & instantiating: file script = new file("./plugins/deft-core/scripts/compass.java"); diagnosticcollector<javafileobject> diagnostics = new diagnosticcollector<javafileobject>(); javacompiler compiler = toolprovider.getsystemjavacompiler(); standardjavafilemanager filemanager = compiler.getstandardfilemanager(diagnostics, null, null); list<string> optionlist = new arraylist<string>(); optionlist.addall(arrays.aslist("-classpath", system.getproperty("java.class.path") + ";./plugins/deft-core.jar")); iterable<? extends javafileobject> compilationunit = filemanager.getjavafileobjectsfromfiles(arrays.aslist(script)); javacompiler.compilationtask task = co...

javascript - Loading cross-domain endpoint with jQuery AJAX -

i'm trying load cross-domain html page using ajax unless datatype "jsonp" can't response. using jsonp browser expecting script mime type receiving "text/html". my code request is: $.ajax({ type: "get", url: "http://saskatchewan.univ-ubs.fr:8080/sasstoredprocess/do?_username=darties3-2012&_password=p@ssw0rd&_program=%2futilisateurs%2fdarties3-2012%2fmon+dossier%2fanalyse_dc&annee=2012&ind=v&_action=execute", datatype: "jsonp", }).success( function( data ) { $( 'div.ajax-field' ).html( data ); }); is there way of avoiding using jsonp request? i've tried using crossdomain parameter didn't work. if not there way of receiving html content in jsonp? console saying "unexpected <" in jsonp reply. jquery ajax notes due browser security restrictions, ajax requests subject same origin policy ; request can not retrieve data different domain, subdomain,...