Posts

Showing posts from February, 2011

php - Recaptcha POST doesn't work with my secret key -

i have form sending email recaptcha, work when use test site-key , secret key found in recaptcha faq recaptcha faq but when insert mine doesn't work, i,ve tried recreate keys problem still remain... suggest? here's php code: <?php $response = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=my_secret_key&response='.$_post['g-recaptcha-response'].'&remoteip='.$_server['remote_addr']); $responsedecoded = json_decode($response); if ( $responsedecoded->success == false ) { echo 'busted!'; exit(); } else{ //here insert code sending email } ?> i think problem here. secret=my_secret_key replace my_secret_key actual secret_key in file_get_contents() .

LINQ syntax - ordering of criteria -

i'm trying understand linq syntax , getting stuck. i've got line gets of people postcode i'm searching for iqueryable<int> personidswiththispostcode = _context.addresses .where(pst => pst.postcode.contains(p)) .select(b => b.personid); this line returns people in personidswiththispostcode persons = persons.where(ps => personidswiththispostcode.contains(ps.personid)); i'd have expected along lines of this, you're looking @ container, checking against subset of values see want. persons = persons.where(ps => ps.personid.contains(personidswiththispostcode)); so sql point-of-view i'd think of this bucket = bucket.where(bucket.contains(listoffish)); but seems act this bucket = bucket.where(listoffish.contains(bucket)); i've read through lots of documentation can't head around apparently simple notion. explain way of thinking appreciated. thanks if personid int can't use ps.personid.

javascript - Clone object with function -

i wanted clone original object , function without reference, code consider correct way clone object , function? var apple = new function() { this.type = "macintosh"; this.color = "red"; } function aaa() { return this.color + ' ' + this.type + ' apple'; }; var = json.parse(json.stringify(apple)) var b = json.parse(json.stringify(apple)); console.log(a) a.getinfo = aaa b.getinfo = aaa a.color='green' // green color console.log(a.getinfo()) console.log(b.getinfo()) for cloning objects, can use object.assign , set first argument empty object. example const clone = object.assign({}, apple.call({})); const result = aaa.call(clone); console.log(result); //=> red macintosh apple; i made use of function.call here because don't know if meant access global this or different scope or what. if do know this referring to, can do. const clone = object.assign({}, this); const result = aaa(); cons

Generating a list of random integers in python 3 -

i getting indexerror: list assignment index out of range error when trying run program. index appears fine (0 through 8) , don't think .append needed since equal sign assign random value each pass. missing? import random #the main function. def main(): #welcome message. print("welcome lottery number generator program!") print() #explain program does. print("note: program randomly generate 7 digit lottery number , display screen. ") print("________________________________________________________________________________________________") print() print() #call generatenumbers function , store returned list in variable lotterynumbers. lotterynumbers = generatenumbers() #call printlottery function , pass lotterynumbers list argument. printlottery(lotterynumbers) #the generatenumbers function generated 7 random digits between 0 , 9 stores them in list , returns list. def generatenumbers(): #a list variable hold empty

model - Joomla component, JModelAdmin using multiple tables to populate form -

i building own component in joomla! 3.7.3. right working on admin part of it. i have 2 models in mvc structure - 1 getting list of items - other 1 getting information single item as far i'm concerned developing model single item comes use jmodeladmin. actually, extending class more specific. there 3 methods in class useful build proper model: gettable(), getform() , loadformtable(); the problem i've got data stored within 3 different tables, , gettable() method allows me use 1 table @ time. is there way data form 3 tables @ once , populate form them? any advice great, cheers

Jmeter - Creating a new variable if variable already exists using Java -

i'm using jmeter , want use java update variables, i have variable called xxvono stores values , adds number suffix when executed in loop. example: xxvono_1 = value1 xxvono_2 = value2 xxvono_3 = value3 these variables contains values automatically stored when loop executed. however, trying make code checks if variable empty or not, if true, save new values, if false, create new variable (xxvono_4) , save value there without overwriting existing variables. how go doing this? use while loop? if (vars.get("vono_2") != "") { if (vars.get("xxvono_" + vars.get("aps200_count_3")) == "") { vars.put("xxvono_" + vars.get("aps200_count_3"), vars.get("vono_2")); vars.put("xxjrno_" + vars.get("aps200_count_3"), vars.get("jrno_2")); } else { while (vars.get("xxvono_" + vars.get("aps200_count_3")) != "") {

logging - Cannot log to Windows Events system on .Net Core 1.1 -

i'm trying add event logging asp.net core 1.1 web api (running on windows server 2012) such: public void configure(iapplicationbuilder app, ihostingenvironment env, iloggerfactory loggerfactory) { loggerfactory.addconsole(configuration.getsection("logging")); loggerfactory.adddebug(); loggerfactory.addeventlog(); } but tells me: 'iloggerfactory' not contain definition 'addeventlog' , no extension method 'addeventlog' accepting first argument of type 'iloggerfactory' found (are missing using directive or assembly reference?) i've tried add "microsoft.extensions.logging.eventlog" project via nuget, says: package microsoft.extensions.logging.eventlog 1.1.2 not compatible netcoreapp1.1 (.netcoreapp,version=v1.1). package microsoft.extensions.logging.eventlog 1.1.2 supports: net451 (.netframework,version=v4.5.1) 1 or more packages incompatible .netcoreapp,version=v1.1. package restore

javascript - Select only those elements which has changed there positions after sorting by .sortable -

i have 5 divs . ordered per priority.i sorting there positions using jquery sortable. there way know position of divs has changed there position during sorting. html section: <body> <div id="sortable"> <?php foreach($data $row){ ?> <div class="alert alert-success" data-id="<?php echo $row['id'] ?>" role="alert"><?php echo $row['div-name']; ?></div> <?php } ?> </div> </body> sctript part: <script> $( function() { var lastmoved = null; $("#sortable div").mousedown(function(){ lastmoved = this; }); $("#sortable").sortable({ start: function(e, ui) { //alert(""); // console.log("prev: "+$(this).attr('data-id')); }, update: function(event, ui) { alert("moving: "+$(lastmoved).attr("data-id")); alert(&qu

objective c - Conversion error OBJ-C to Swift 3 -

i trying convert ezaudio ( https://github.com/syedhali/ezaudio ) objective-c library swift 3. doing "ezaudioplayfileexample" part in it. objective-c - (void)openfilewithfilepathurl:(nsurl*)filepathurl { self.audiofile = [ezaudiofile audiofilewithurl:filepathurl]; self.filepathlabel.text = filepathurl.lastpathcomponent; // // plot whole waveform // self.audioplot.plottype = ezplottypebuffer; self.audioplot.shouldfill = yes; self.audioplot.shouldmirror = yes; // // audio data audio file // __weak typeof (self) weakself = self; [self.audiofile getwaveformdatawithcompletionblock:^(float **waveformdata, int length) { [weakself.audioplot updatebuffer:waveformdata[0] withbuffersize:length]; }]; } swift 3 func openfilewithfilepathurl(filepathurl: nsurl) { self.audiofile = ezaudiofile(url: filepathurl url!)

android - How to detect uninstall event in Cordova app using node.js using React -

i want clear cache of application when app uninstalled device (android or ios). there way this? thanks. ios applications contained within sandbox. few exceptions (like keychain or photo library) data app has access to, or can write to, in sandbox. uninstalling app on ios equals deleting application sandbox. means deleting app removes data stored application, including cache.

Spring Boot & Stomp, random client disconnecting -

i have spring boot websocket server application , stomp client connected to. have 1 client connected server , needs connected (one week , more) session lifetime. notice random ws connection interrruption or "freeze" . after each interruption need reset client , reconnect server manually. didn't notice physical internet interruption etc. can on code , give me advices if: -anything wrong? -did miss , reasone of random interruptions? websocket server configuration @configuration @enablewebsocketmessagebroker public class websocketconfig extends abstractwebsocketmessagebrokerconfigurer { public static final string ws_commands_main_queue = "/topic"; @override public void configuremessagebroker(messagebrokerregistry config) { config.enablesimplebroker(ws_commands_main_queue); config.setapplicationdestinationprefixes("/app"); } @override public void registerstompendpoints(stompendpointregistry registry) { registry

javascript - Line break data every N elements, when converting and image to hex -

i'm trying insert line break code, when image data output hex, there line break every 150 values. thought appeand line break , use modulus remainder = 0 determine if value divisible 150. to tried... if (i % 150==0) not output correctly. code: for (var = 0, n = imagedata.length; < n; += 4) { // r in rgba var de = imagedata[i]; // g in rgba var ne = imagedata[i + 1]; // b in rgba var eu = imagedata[i + 2]; // in rgba (opacity). don't use in our calculation. if you'd enable // it, uncomment code directly below it. var ah = imagedata[i + 3]; // uncomment code enable accurate opacity in images // http://stackoverflow.com/questions/2049230/convert-rgba-color-to-rgb // de = ((1 - ah) * de) + (ah * de); // ne = ((1 - ah) * ne) + (ah * ne); // eu = ((1 - ah) * eu) + (ah * eu); var hexi = // each 1 of these take r, g or b converts hex , con

report builder2.0 - Delphi ReportBuilder columns issue -

Image
i working delphi xe6 reportbuilder version 15.05 build 275. i want print images on paper decided user. eg: say width of paper 10 cm , report column property set 2 column width 10/2 = 5 cm each. we leave margin @ beginning, draw images in first column , column width / 2 = x cm. so start second column x cm + initial margin. starts x cm point only. i want place images in 'n' columns. how draw in second column?

php - Exception error with cache:clear with Class Doctrine\Common\Inflector\Inflector -

when run composer update following error when cache:clear script called. > sensio\bundle\distributionbundle\composer\scripthandler::clearcache php fatal error: class 'doctrine\common\inflector\inflector' not found in /home/sarah/workspace/telematics_tracker/vendor/doctrine/common/lib/doctrine/common/util/inflector.php on line 29 [runtimeexception] error occurred when executing "'cache:clear --no-warmup'" command: php fatal error: class 'doctrine\common\inflector\inflector' not found in /home/sarah/workspace/telematics_tracker/vendor/doctrine/common/lib/doctrine/c

performance - How define jQuery validate setDefaults -

i have problem code. use jquery validate validate form. question how run setdefaults method? because when looking @ in debugger, error this: typeerror: jquery.validator undefined jquery.validator.setdefaults({ success : "valid" }); $("#myform").validate({ rules : { "file1" : { required : true, extension : "slx|mdl", accept : false }, "file2" : { extension : "m", accept : false }, "file3" : { extension : "xlsx|xls", accept : false }, "file4" : { extension : "pdf", accept : false } } }); setdefaults need variab

Java Equivalent code for python's Base64 conversion -

i using python's base64.b64encode() function encode file(txt,mp3 etc) need java equivalent function same.currently using function base64.getencoder().encodetostring(content.getbytes()); encode file in java.the result same in case of txt files(in both java , python) differs in case of mp3 files. is there encoding method in java obtain same result?if not, other encoding schemes obtain same result in both languages?

swift - Is there any function which returns "time until Device Battery is fully charged" -

i have found answer display battery percentage code following class viewcontroller: uiviewcontroller { @iboutlet var infolabel: uilabel! var batterylevel: float { return uidevice.current.batterylevel } var timer = timer() func scheduledtimerwithtimeinterval(){ timer = timer.scheduledtimer(timeinterval: 60, target: self, selector: #selector(self.somefunction), userinfo: nil, repeats: true) } func somefunction() { self.infolabel.text = string(format: "%.0f%%", batterylevel * 100) } override func viewdidload() { super.viewdidload() uidevice.current.isbatterymonitoringenabled = true somefunction() scheduledtimerwithtimeinterval() // additional setup after loading view, typically nib. } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. }} the problem remaining time thanks in advance you can try measure battery level on period of time , calculate

html - Aligning images and text in a row -

i'm building site has 'meet team' page. 'team' section has 2 rows 3 sets of images text underneath. want rows aligned 1 under other @ minute can't make happen. here's code snippet - .container { margin: auto; max-width: 100%; padding-left: 10px !important; padding-right: 10px !important; } #team div.row { height: 250px; width: 100%; text-align: center; } section#team .four { display: inline-block; padding: 0; margin: 0; border: 0; } <section id="team"> <div class="container"> <div class="twelve columns"> <h4>meet team</h4> <div class="row"> <div class="four columns"> <img src="http://localhost:8888/wp-content/uploads/2017/07/hot-air-balloon.jpeg" alt="me

ios - How to close Callkit screen after VOIP call disconnected -

i trying remove callkit screen once voip call disconnected source or destination. i used code cxendcallaction *endaction = [[cxendcallaction alloc] initwithcalluuid:[nsuuid uuid]]; cxcallcontroller *callcontroller = [[cxcallcontroller alloc] initwithqueue:dispatch_get_main_queue()]; requesttransaction:[cxtransaction transactionwithactions:nil completion:completion]]; but not working close callkit. can 1 me solve issue? you have pass cxtransaction cxendcallaction requesttransaction . first of in initwithcalluuid have pass current call nsuuid . can call requesttransaction on cxcallcontroller , pass [cxtransaction transactionwithactions:@[endaction] it, instead of nil did. cxendcallaction *endaction = [[cxendcallaction alloc] initwithcalluuid:[nsuuid uuid]]; // current call uuid cxcallcontroller *callcontroller = [[cxcallcontroller alloc] initwithqueue:dispatch_get_main_queue()]; [callcontroller requesttransaction:[cxtransaction transactionwithactions:@[endac

java - JPA: store OneToMany-Relationship into a map -

i have problems storing onetomany-relationship map. use jpa/hibernate spring. this code: @table(name = "room_member", uniqueconstraints = @uniqueconstraint( columnnames = { "room", "member" })) public class roommember { @id @generatedvalue(strategy = generationtype.table) private long id; @manytoone(optional = false) @joincolumn(name = "room") private room room; @manytoone(optional = false) @joincolumn(name = "member") private member member; // getters , setters omitted } the class want map: public room { @id @generatedvalue(strategy = generationtype.table) private long id; @onetomany(mappedby = "room") @mapkeyjoincolumn(name = "member") private map<member, roommember> roommember; // getters , setters omitted } i cant running, because nullpointerexception org.springframework.beans.factory.beancreationexception:

linux - When running a program in parallel on multiple processors in shared-memory space, does each processor have it's own .TEXT segment? -

this user asked why 2 linux processes of same file not share same text segment, responder replied modern operating systems sandbox programs default , shared libraries entities not duplicated os (not including storage memory). while researching earlier, however, found (1) other (2) questions (3) talked how operating system trying balance optimization process-memory protection, , through combination of virtual memory addressing , page table lookups, optimizations copy-on-write , 2 programs could sharing same .text segment, although wouldn't aware of it. correct in saying this? excerpt: real thing text section shared mapping different virtual pages same physical pages (called frames). the reason ask because we're working on molecular dynamics simulator runs in shared memory-model , we're trying determine whether there 1 processor tasked burden of holding program code, or if every processor requires own local copy. (there 6,000 processors.) the thing confuse

php - How to use j query element on {{ Laravel Blade }} -

Image
**i need use element val select row database using laravel blade attachment img pls you can't, need use ajax requests this. please read this article on differences between client , server side programming .

Laravel Excel ExcelFile injections -

i've read tutorial maatwebsite. according tutorial, using excelfile class. here link but confusing part is, never wrote file name nor location of file. please guide me. thanks edit: meant code: class userlistimport extends \maatwebsite\excel\files\excelfile { public function getfile() { return storage_path('exports') . '/file.csv'; } public function getfilters() { return [ 'chunk' ]; } } where put it?

git - Sharing the same repository between two projects using SourceTree -

Image
i'm trying find out if it's possible share same repository between 2 projects git/sourcetree. i have 2 sites own repos, both have plugins folder. currently, changes apply 1 plugin, have same plugin on other site. i've created 3rd repo plugins (i.e. plugfolder1/2/3), i've not included file1.asp, file2.asp, .gitignore unique site. is possible share plugins repo , pull content sitea/b plugins folders. way can make changes plugins in receptive site , commit changes plugins repo other sites pull. i've looked submodule , subtree, when try add them via sourcetree, don't understand how i'm able pull content plugins repo site plugins folder. i have never used complex stuff within git , don't want wrong. current setup **sitea** index.asp someotherfile.asp > plugins .gitignore file1.asp file2.asp plugfolder1 plugfolder2 plugfolder3 **siteb** index.asp someotherbfile.asp > plugins .gitignore file1.asp f

typescript - Ionic running platform check not working as what API described -

i working ionic-angularjs framework gives me following definitions platform: android - on device running android. cordova - on device running cordova. core - on desktop device. ios - on device running ios. ipad - on ipad device. iphone - on iphone device. mobile - on mobile device. mobileweb - in browser on mobile device. phablet - on phablet device. tablet - on tablet device. windows - on device running windows. i have code written in typescript, if condition not work when application run on mobile browsers. expect receive mobileweb doesn't seem working. import { platform } 'ionic-angular'; @component({...}) export mypage { constructor(public platform: platform) { if (this.platform.is('core') || this.platform.is('mobileweb')) { // login page } else{ // home page } } } however doesn't seem work. suggestion on how can fix problem. you need make sure platform ready before

node.js - Using letsencrypt with Node Express application -

i'm trying make switch https application. want use letsencrypt, tutorials i've seen online states requires separate agent setup, renew certificate @ constant intervals. found greenlock-express seems bake renewal process https wrapping of express application, not need setup separate server acting renewal agent (or have misunderstood purpose?). this have far: // express import * http 'http'; import * https 'https'; import * e 'express'; const lex = require('greenlock-express'); /** run using myserver.initialize(process.argv) **/ export class myserver { public app: e.express; private clientpath = path.join(__dirname, './public'); static initialize(args: string[]): promise<any> { return new myserver() .start(args) .catch((error: any) => console.error(error); } constructor() { } start(args: string[]): promise<https.server> { // simplified code here, in order display relevant info r

android - Toolbar in fragment doesn't display its title -

the style of activity "theme.appcompat.light.noactionbar". there toolbar in fragment, added activity later. i cannot set title of actionbar. codes below don't work. please me. how set title of toolbar in fragment? //in fragment @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fragment_main2, container, false); toolbar toolbar = (toolbar) rootview.findviewbyid(r.id.toolbar); int = getarguments().getint(arg_section_number); toolbar.settitle("aaa"); ((appcompatactivity) getactivity()).setsupportactionbar(toolbar); charsequence title = ((appcompatactivity) getactivity()).getsupportactionbar().gettitle(); ((appcompatactivity) getactivity()).getsupportactionbar().setdisplayhomeasupenabled(true); try @override public view oncreateview(layoutinflater in

rest - GraphQL not for public API -

is graphql overkill regular application, not public api? if develop application know endpoint need return predefined set of data. what benefits can give graphql comparing rest or rpc, if develop both, backend , frontend. whether it's overkill more matter of scale , effort else. directly address first question, graphql designed "regular applications" rather public apis - use latter relatively new thing being pioneered community rather graphql's creators. rather repeating answers exist in numerous forms in numerous places, i'm going suggest watch of original talks introducing graphql world, these got adopters excited, , should answer lot of questions: data fetching react applications @ facebook lee byron - exploring graphql

html - how to show chars on default page? -

i page web aplication index.html file login page. after succes log in want load page routeprovider using charts draw diagrams . have error when loading index.html logg in not page using charts. my error looks error: please set height , width chart element i@http://localhost:8080/pos/js/angular-charts.min.js:1:12049 y/<@http://localhost:8080/pos/js/angular.min.js:70:91 z@http://localhost:8080/pos/js/angular.min.js:70:149 a@http://localhost:8080/pos/js/angular.min.js:59:203 g@http://localhost:8080/pos/js/angular.min.js:51:299 g@http://localhost:8080/pos/js/angular.min.js:51:316 g@http://localhost:8080/pos/js/angular.min.js:51:316 g@http://localhost:8080/pos/js/angular.min.js:51:316 f/<@http://localhost:8080/pos/js/angular.min.js:50:415 ngviewfillcontentfactory/<.link@http://localhost:8080/pos/js/angular-route.js:983:7 z@http://localhost:8080/pos/js/angular.min.js:70:149 a@http://localhost:8080/pos/js/angular.min.js:59:203 g@http://localhost:8080/pos/js/angular.min.js

Create json object with multiple array in c# -

i want create json object following format:- { "result": [ { "name": "john", "address": "us", }, { "name": "josh", "address": "japan", } ], "error": [ { "message": "error-message" } ], "success": [ { "message": "success-message" } ] } i have tried following, doesn't me. dynamic record = new { result = new {name="", address=""}, error = new {message=""}, success = new {message=""} }; update 1:- here code:- list addresslist = new list(); // loop on items within container , uri. foreach (var item in items) { dynamic record = new { result = new object[] { new {name = item.name, address = item.address} } }; addressl

php - similar sphinxsearch geodistance sorting in elasticsearch -

i have done aggregation name geo-distance sorting not working properly. have achieved aggregation , distance calculation. don't know how soring bucket distance value. kindly suggest me how achieved? mapping:- put /museums { "mappings": { "doc": { "properties": { "location": { "type": "geo_point" } } } } } data values: post /museums/doc/_bulk?refresh {"index":{"_id":1}} {"location": "52.374081,4.912350", "name": "nemo science museum"} {"index":{"_id":2}} {"location": "52.369219,4.901618", "name": "museum het rembrandthuis"} {"index":{"_id":3}} {"location": "52.371667,4.914722", "name": "nederlands scheepvaartmuseum"} {"index":{

business intelligence - OBIEE 12.2.1.2 - Dashboard Customizations - Dashboard Properties -

i want know if there way dashboard properties window activating "hide" option in latest obiee release. i.e. rearranging pages within dashboards using catalog manager , not using dashboard properties window. ideas , suggestions appreciated. through gui? no. can directly in xml stored in file system that's not supported way of doing it.

solr - DeltaImport fetches all the data -

Image
i'm indexing data database. i'm using delta import fetch updated data. however, find fetching whole data twice , processing once though changes applicable 1 row. my config.xml deltaquery given: <dataconfig> <datasource type="jdbcdatasource" driver="com.github.cassandra.jdbc.cassandradriver" url="jdbc:c*://127.0.0.1:9042/test" autocommit="true" rowlimit = '-1' batchsize="-1"/> <document name="content"> <entity name="test" query="select * person" deltaimportquery="select * person seq=${dataimporter.delta.seq}" deltaquery="select seq person last_modified > '${dataimporter.last_index_time}' allow filtering" autocommit="true"> <field column="seq" name="id" /> <field column="last" name="last_s" /> <field column="first" name="fi

css - Material design elevations - movement on vertical axis? -

i've been trying make sense of google's material design guidelines. i'm looking @ them web perspective rather app. i've read section on elevations on , on , can't quite work out whether vertical axis in meant move on 'press'. what know shadows bigger - part i've sorted, however, 1 of illustrations google provides shows floating action button - pressed state seems vertically 6px above unpressed state. in other illustrations, objects remain inline. have definitive answer - should dynamic components move upwards on state change?

javascript - Is there a performance difference between import * as _ from 'lodash' and import { indexOf } from 'lodash' -

i wondering if there difference in memory , performance between 2 import. if have lodash in node module, compile file anyway no matter import? in theory, based on specification import , yes, there supposed difference. the specification allows compliant optimization use static analysis of named import in order load required provide indexof() , if lodash module written es2015 module. it create importentry record keeps references how resolve import when running static analysis on es2015 module, relevant export 's evaluated. in practice, not simple, , since there not native implementation, transpilers babel convert es2015 import syntax commonjs functional equivalent. unfortunately, functionally equivalent method must still evaluate entire module , since exports not known until has been evaluated. this why es2015 specification requires import , export in top-level scope, static analysis allow javascript engine optimize determining portions of file can safe

linux - Perform stress tests on API -

i have developed api lumen framework, api consumed through mobile applications (android / ios), now, need know performance of api, example how many concurrent requests support? how can perform type of test? the complete stack linux, apache, php (lumen), mysql.

Copy one file content (data) to other file file in the specific area using python Logic -

i have experience in c programming languange , started work on python c backround. we have file names example 1.txt , 2.txt. taking content of 1.txt , writing in 2.txt given line number , lines in 2.txt moved down automtically - using below logic: f = open("1.txt", "r") contents = f.readlines() f.close() open("2.txt") f: data = f.read().rstrip("\n") line =19 contents.insert(line, data) f = open("1.txt", "w") contents = "".join(contents) f.write(contents) f.close() this logic working problem facing last line written immideatly after 1.txt content. ( per requiremnt has start form next line) tried "\n" not able achive. for more clarity below. 1.txt : hello hello hello hello 2.txt: 123 456 789 451 234 suppose if execute code above 1.txt , 2.txt files ( , want write data between 789 , 451). after executing script 2.txt looks below: 123 456 789 hello hello hello

Get Height of layer or selection in Photoshop with AppleScript -

i having lot of trouble trying height of layer or selection of layer in photoshop using applescript. end goal height of lets layer , height of layer b , find difference. part of bigger script nothing or search seems yield answers. thanks in advance! tell application "adobe photoshop cc 2015.5" -- replace version of photoshop have activate set thedimensions bounds of current layer of document 1 set thewidth item 3 of thedimensions set theheight item 4 of thedimensions set thedimensions thewidth & theheight end tell i use inches unit of measurement in photoshop documents script returns values inches in results. assume if use pixels or other… script return appropriate values if not need width values in script, comment them out here version height only tell application "adobe photoshop cc 2015.5" -- replace version of photoshop have activate set thedimensions bounds of current layer of document 1 --set thewid

angular - Primeng Button not showing label -

i have primeng button in angular4 application. label of button not displaying.button displaying small without label. <div id="main"> <form #newjobcleanupform="exform" (ngsubmit)="onsubmit(exampleform)"> <label class="stylelabel" for="jobnumber"><span>job number</span> <input type="text" pinputtext class="styletext" id="jobnumber" required [(ngmodel)]="jobnumber" name="jobnumber"> <button pbutton type="button" label="click"></button></label> </form> </div> this issue caused missing import of primeng's buttonmodule. please add import same module, component defined in. import {buttonmodule} 'primeng/primeng'; ... @ngmodule({ imports: [ ... buttonmodule ] ...

java Mailgun email validation API response not working -

can 1 please? i have created test mailgun domain , have public , private api key. i using jersey client validate email address using mailgun api. don't json response instead string "mailgun magnificent api". below piece of code public static clientresponse validateaddress() { client client = client.create(); client.addfilter(new httpbasicauthfilter("api", myapikey)); webresource webresource = client.resource("https://api.mailgun.net/v3/sandboxxxxx.mailgun.org/validate"); clientresponse response = webresource.queryparam("address", "mamta.solanki@ecrebo.co.uk").accept("application/json").type(mediatype.application_json_type).get(clientresponse.class); return response; } public static void main(string args[]) { clientresponse res = validateaddress(); system.out.println(res);}

arduino - How to find specific Teensy in COM list -

i new first project making skype notification cube teensylc , leds. know can hard-code com port communications if unplug , use different plug com port changes. i'd able plug board in , have software find automatically. [edit] it looks didn't express myself first time, let me try again. if call serialport.getportnames() array of {"com1", "com2", "com3"}. if make new serialport() using names properties same. there's nothing can see differentiate teensylc other com port. what best way find teensy board without knowing com port?

html5 - What event will capture the resizing of the browser window? -

i have custom slider, shown when user clicks on font awesome button.this model works quite me. add event listener slider object focusout event, , show or hide slider. i notice when user resizes browser screen, not seen focusout, because in case slider not disappear ( to). so question is, event capture resizing of browser window, in order me hide slider way? thanks!

sapui5 - How to d3.js in UI5? (View.xml | controller.js) -

i have ui5 webapp sites. how can add d3 graph webapp. dont know how should write in view(xml) , controller (js). can me please? greetings florian imo, not question, rather request write application you. not problem if willing pay :) try more specific , own investigation in advance. example: overflow , sap , etc.. the last link contains pretty need know. high level overview: create custom control using sap.ui.core.control.extend override metadata + ui5 controls lifecycle methods (like oonafterrendering) write renderer put there d3js coding

rest - Are public POST routes dangerous if they don't hit the database? -

i'm creating simple calculator api. on there have endpoint named /calculate . can post few params , run calculation. i'm using basic authentication know isn't have enabled testing. my question is: having route open public hit bad idea? type of issues face or if it's simple calculations not problem? any insight dangers brings great, thanks!

javascript - How to change a parameter inside an object? -

begginer here. var player() = { isdrunk: false } how set isdrunk true after player uses item "beer"? (completely made-up example) to answer question player.isdrunk = true so have var player = { lefthanded: false, righthanded: true, isdrunk: false }; and then function drinkbeer(player) { player.isdrunk = true; } then can pass players drinkbeer function needed. alternatively can put function inside player object if want each individual player have drinkbeer() function can use change own isdrunk property calling player.drinkbeer() that this: var player = { lefthanded: false, righthanded: true, isdrunk: false, drinkbeer: function() { isdrunk = true; } };

(AngularJS) Make a "ng-show" true specifically for one element in a ng-repeat -

i'am begining in angular, , i'am asking if possible make "ng-show" true 1 element in "ng-repeat", , make false others? i explain myself code: html file : <tbody ng-repeat="elem in list" ng-init="visible = false"> <tr ng-class="elemselected(elem)"> <td colspan="3"> <a href ng-click="clickelemscroll(elem)" > <span class="glyphicon" ng-class="visible? 'glyphicon-chevron-down' : 'glyphicon-chevron-right'"></span> <strong>{{elem.name}} </strong> </a> </td> </tr> <tr ng-show="visible" > blabla </tr> </tbody> j

database - How to efficiently compare two subsets of rows of a large table? -

i use postgresql 9.6 , table schema follows: department, key, value1, value2, value3, ... each department has hundreds of millions of unique keys, set of keys more or less same departments. it's possible keys don't exist departments, such situations rare. i prepare report 2 departments points out differences in values each key (comparison involves logic based on values key). my first approach write external tool in python that: creates server-side cursor query: select * my_table department = 'abc' order key; creates server-side cursor query: select * my_table department = 'xyz' order key; iterates on both cursors, , compares values. it worked fine, thought more efficient perform comparison inside stored procedure in postgresql. wrote stored procedure takes 2 cursors arguments, iterates on them , compares values. differences written temporary table. @ end, external tool iterates on temporary table - there shouldn't many rows there. i though

Xamarin Live Error with SQLite -

i have error using sqlite xamarin live in shared project error : uncaught exception no body on method sqlite.sqliteasyncconnection.. the code connection is: [assembly: dependency(typeof(sqlitedb))] namespace helloworld.ios { public class sqlitedb : isqlitedb { public sqliteasyncconnection getconnection() { var documentspath = environment.getfolderpath(environment.specialfolder.mydocuments); var path = path.combine(documentspath, "mysqlite.db3"); return new sqliteasyncconnection(path); } } } the code in page is: public usingcrud() { initializecomponent(); //call getconnection() method , link our private field. _connection = dependencyservice.get<isqlitedb>().getconnection(); }

java - maven equivalent for gradle `compile fileTree(dir: 'libs', include: '*.jar')` -

what maven equivalent gradle's one-liner include jars lib(s) folder? i.e. : dependencies { compile filetree(dir: 'libs', include: '*.jar') } i have set of project mavenize, , average project ~50 jar in lib folder, takes @ least half day thorough searching on http://mvnrepository.com/ , guessing versions , jar dependencies looking inside jar etc work solve technical debt of jar hell. the problem old, , of july 2017, 1 can find - how include system dependencies in war built using maven - how add local jar files in maven project? listing similar answers limitations. new me plugins - addjars-maven-plugin , dead @ https://github.com/kahing/addjars-maven-plugin - non-maven-jar-maven-plugin @ https://github.com/stephenc/non-maven-jar-maven-plugin thinking on again, first step mavenize project should let compiler use existing jars focus on code, not on dependencies (that has jar put there case, or copied in bulk) <!-- not work --> &