Posts

Showing posts from January, 2014

plsql - #PLSQL_Trigger duplicate customer doesnt work -

homework requirement: create trigger account must belong 1 , 1 customer. my code shown below doesn't work. error mesg: quoted string not terminated. please help. create or replace trigger dupcust before insert or update on account each row declare v_ctn number; begin select count(account.cname) v_ctn account a#=:new.a#; if v_ctn>0 raise_application_error (-20107, 'acct can belong 1 customer'); end if; end; test code: update account set account.cname =’cook’ account.a# = ‘1111’; when copied query, failed due quotes around string cook , 1111. apparently used wrong quote character, corrected quotes , when run query, trigger generates mutation error, answer can can found here: plsql trigger error. "is mutating, trigger/function may not see it" ora-04091 basically reading table updating, causes mutation, can't that. a compound trigger, if written correctly, job, example here: oracle trigger after insert or

javascript - How to persist anonymous user in phonegap app when using Firebase? -

i using firebase anonymously login user, it's not important me user long it's same person. each new person given unique id firebase. i understand how unsigne-in user anonymous user id in firebase not how login in user later on user id. when phonegap app closes anonymous data lost, if find way persist data, dont see anyway relogin again same anonymous user.

elixir - Partial updates in Phoenix and function signature -

i want create partial update method via ajax/json. how should "update" function like? def update(conn, %{"a" => a, "b" => b, "c" => c} = params) # .... end namely, 1 of these parameters required at time . how can specify that? or should instead this: def update(conn, params) # .... end check if params contains a , b or c ? you can use pattern matching define possibilities: def update(conn, %{"a" => a} = params) # when have "a" end def update(conn, %{"b" => b} = params) # when have "b" end def update(conn, %{"c" => c} = params) # when have "c" end def update(conn, params) # handle else end

xlsx - How can I minimize this code? because excel said it has more than 64 conditions -

Image
note: texts equivalent $c$1 dropdown list. =if( $c$1="", "", if( $c$1="aglayan 1", t4, if( $c$1="aglayan 2", ai4, if( $c$1="alabel", ax4, if( $c$1="babak 1",bm4,if($c$1="babak 2",cb4,if($c$1="banaybanay",cq4,if($c$1="banga",df4,if($c$1="bansalan",du4,if($c$1="bansalan 2",ej4,if($c$1="bansalan 3",ey4,if($c$1="barobo",fn4,if($c$1="batobato",gc4,if($c$1="bayugan",gr4,if($c$1="buhangin",hg4,if($c$1="calinan",hv4,if($c$1="carmen",ik4,if($c$1="compostela 1",iz4,if($c$1="compostela 2",jo4,if($c$1="cugman",kd4,if($c$1="digos 1",ks4,if($c$1="digos 2",lh4,if($c$1="digos 3",lw4,if($c$1="don carlos 1",ml4,if($c$1="esperanza 1",na4,if($c$1="esperanza 2",np4,if($c$1=&qu

Visual Studio 2015 solutions backwards compatibility with Visual Studio 2013 -

it seems can open vs 2013 solution file in vs 2015. i've few questions regarding backwards compatibility: can vs 2013 solution maintained in vs 2015 safely without losing capability work on in vs 2013? can vs 2015 solution maintained in vs 2013? i can try out myself, know if there documented caveats should aware of. i found official docs on files supported when upgrading solutions in visual studio in msdn article porting, migrating, , upgrading visual studio projects . the key takeaway here in opening paragraph. if use visual studio 2015 visual studio 2013,visual studio 2012 or visual studio 2010 sp1, can create , modify projects , files in of versions. can transfer projects , files among versions long don't add features not supported 1 of versions. you can run same solution in different versions of visual studio long don't implement feature in higher version not supported in lower version. this applies not vs 2015-2013 compatibility, vs 2012

sql - Navision 5.0 number series from stored procedure -

is there chance number series value stored procedure? i'm trying integrate navision 5.0 using sql tables. maybe number series stored in sql table? or there function? number series stored in tables no. series , no. series line. in line table can find last used number each series. nex number have implement same function nav built-in incstr . next lock line table. last used number. increase it. use like. save line table wouldn't used nav. that's it.

.net - Is Metro Framework NuGet Package free or not? -

i saw metro framework on nuget packages provides me lot better ui winforms application, want use framework in winforms application, not sure licensing. read license in "view license" option , reads out "free of charge", on other hand metro framework paid framework (i assume). so confused whether should use framework in application or not, not able decide on kind of license has. help appreciated. thank you. permission hereby granted, free of charge, person obtaining copy of software , associated documentation files (the "software"), deal in software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of software, , permit persons whom software furnished so, subject following conditions: the above copyright notice , permission notice shall included in copies or substantial portions of software. ( https://github.com/thielj/met

java - how do i compare each character of a same string using a for loop? -

so have make program have compare each character of string see if occur in string more once or not, if occur more once have delete string array list instance "peer" , "pear" should remove "peer" because there 2 e's in "peer", how go doing this? here hint. check whether there duplicate character can use set . for each character of string check if char in set if yes can delete string arraylist , stop checking string else add char set

qt - Coloumn with Buttons not visible in Table Derived from qAbstractTableModel -

i have 1 one class derived abstracttablemodel , custom delegate implemented columns. sorting purpose have used qsortproxyfiltermodel sort table contents. problem facing in 1 of mine column have buttons not visible. here sample code: sortproxymodel *proxymodel = new sortproxymodel; tablemodel* mymodel = new tablemodel; myview *view = new myview; proxymodel->setsourcemodel(mymodel); view->setmodel(proxymodel); i using openpersistenteditor coloumn having buttons. feedback of great help.

c - can VirtualAlloc replace VirtualProtect -

virtualalloc function reserves, commits, or changes state of region of pages in virtual address space of calling process. memory allocated function automatically initialized zero. virtualprotect function changes protection on region of committed pages in virtual address space of calling process. change access protection of process, use virtualprotectex function. as above(from msdn) says, virtualalloc can change protection state of committed pages virtualprotect. wondering whether virtualprotect can replaced virtualalloc.thanks. the following example of using virtualalloc change protection type of committed pages. lpvoid lpaddress = null; size_t dwsize = 0x40000; dword flallocationtype = mem_commit; dword flprotect = page_readwrite; lpvoid newaddress; newaddress = virtualalloc(lpaddress, dwsize, flallocationtype, flprotect); if(newaddress == null) { printf("error %d occurs\n", getlasterror()); return -1; } printf("allocation address %p\n", ne

python - how to make an Entry Field mandatory to enter some text? -

like in html tag attribute required=required i want make entry widget mandatory, user must enter data in it, otherwise don't proceed next step. how tkinter? thank in advance there no attribute "required" in tkinter, need write function check whether user entered data in entry or not. use function command of "next" button. import tkinter tk def next_step(): if mandatory_entry.get(): # user entered data in mandatory entry: proceed next step print("next step") root.destroy() else: # mandatory field empty print("mandatory data missing") mandatory_entry.focus_set() root = tk.tk() mandatory_entry = tk.entry(root) tk.label(root, text="data *").grid(row=0, column=0) mandatory_entry.grid(row=0, column=1) tk.button(root, text='next', command=next_step).grid(row=1, columnspan=2) root.mainloop()

linux - replace null to ""test"" in a file using unix -

i have below pattern in file @ different lines ""key"": null i want replaceu ""key"": ""test"" through linux i used below commands: sed -i 's/ null / ""test"" /' sed -i 's/ null / \"\"test\"\" /' but failed. this should it: sed -i 's/null/\"\"test\"\"/g' file.txt

jquery - Posting to Wordpress API using oAuth1.0 -

so, spent days getting oauth authentication token , able create posts using postman. now i'm trying implement authentication on site , getting 401 error. request header looks this: var createrecipe = new xmlhttprequest(); createrecipe.open("post", "/wp-json/wp/v2/recipes"); createrecipe.setrequestheader("authorization", 'oauth oauth_consumer_key="consumerkey", oauth_token="oauthtokenhere", oauth_signature_method="hmac-sha1",oauth_timestamp="1491374534", oauth_nonce="'+magicaldata.nonce+'", oauth_version="1.0", oauth_signature="myoauthsighere"'); createrecipe.setrequestheader("content-type", "application/json;charset=utf-8"); createrecipe.send(json.stringify(recipedata)); createrecipe.onreadystatechange = function() { if (createrecipe.readystate == 4) { if (createrecipe.status == 201) { cons

Find all github shell scripts created on a particular day -

i want search github shell scripts created on particular day. im using search feature on github following query "/bin/bash" created:2017-01-01 extension:sh when click on "code", large number of file matches show up, not created on day. what doing wrong? thanks!

C# Xamarin load image from url -

i trying load image url string. below code array of items, photo loads image. included image hard disk , loaded image in photo = "image_name.jpg" this first code: public mainpageviewmodel() { items.add(new cardstackview.item() { name = "title 1", photo = " xxx ", description = "desc 1" }); items.add(new cardstackview.item() { name = "title 2", photo = " xxx ", description = "desc 2" }); items.add(new cardstackview.item() { name = "title 3", photo = " xxx ", description = "desc 3" }); items.add(new cardstackview.item() { name = "title 4", photo = " xxx ", description = "desc 4" }); items.add(new cardstackview.item() { name = "title 5", photo = " xxx ", description = "desc 5" }); items.add(new cardstackview.item() { name = "title 6", photo = " xxx ", description = "

java - Comparing Arrays for common integer -

newbie here , new java itself. working on little project , stumped at. code has 2 arrays, passes these arrays down method. @ point method supposed , compare arrays, find highest common int in case program 10, program take 10 , return main printed out, program assuming possible there no common number in case print out -1. here code far. public class arraycompare { public static void main(string [] args) { int [] arraya = {2, 4, 6 , 8, 10, 12}; int [] arrayb = {3, 4, 7 , 10, 11,13}; int result = largestincommon(arraya , arrayb); } public static int largestincommon( int [] a, int[] b) { int counter = 0; for( int x = 0; x < a.length; x++) { if(a[0]==b[x]) { for(int y = 0; y < b.length; y++) } } } } loop on elements of 2 arrays. check if every element equals other , higher last higher element. if is, new higher element int[] arraya = { 2, 4, 6, 8, 10, 12 };

java - NanoHttpd : File Not Found when trying to serve a file -

i've been trying create server on android servers files mp3. challenge when serving mp3, file not found exception here's server class below. public class server extends nanohttpd { private static final string mime_audio = "audio/mpeg"; private string uri; public server(string uri,string type) throws ioexception { super(8081); this.uri = uri; start(nanohttpd.socket_read_timeout, false); } @override public response serve(ihttpsession session) { fileinputstream fis = null; try { fis = new fileinputstream(environment.getexternalstoragedirectory() + "/"+uri); } catch (filenotfoundexception e) { e.printstacktrace(); } try { int bytes = 0; if(fis != null){ bytes = fis.available(); } return newfixedlengthresponse(respon

php - Unable to Run Form Request Validation on Lumen -

we using form request validation laravel. i'm trying use same requests lumen, doesn't work espected. usercontroller <?php namespace app\http\controllers; use app\http\requests\user\userpostrequest; use app\macx\logic\interfaces\iuserlogic; use illuminate\http\request; use illuminate\support\facades\auth; class usercontroller extends controller { private $userlogic; public function __construct(iuserlogic $userlogic) { $this->userlogic = $userlogic; } public function post(userpostrequest $request) { return $this->userlogic->post(auth::user(), $request->all()); } } userpostrequest <?php namespace app\http\requests\user; use illuminate\support\facades\request; class userpostrequest extends request { /** * determine if user authorized make request. * * * @return bool */ public function authorize() { return true;

php - Shopify app development clarification -

how develop shopify app , done few step's mentioned in below link, 1.i install shopify app below link guidelines, https://www.sitepoint.com/shopify-app-development-made-simple/ (upto update access_token in install table of above link) and deploy app in https://apps.shopify.com/testapp-64 my req. need add 2 pages namely 1 page add record(title,desc., , 1 image) , 1 display avilable record. where create 2 page ? in own domain or else ? how store data in shopify app , fetch display data in shopify admin ui ? how display app data in front-end page of product details below "add cart" after app value selection user click add cart button , in cart page need include selected value of app. for sample data example, backend view page s.no title desc image 1. aaa bbb google.obj 2. ccc ddd test.jpeg in product detail page, need displ

ios - Button background Image in swift 3 -

Image
i add background image button in swift. actual image size 100x100 . idea when click on image, popup of change profile image appear. then, can choose photos gallery , save. after saving photo, image shows fully. but, problem before choose photo gallery, set default image. please see in following screenshot image. profile female image should big background green color. here code. let img = uiimage(data: match.value(forkey: "imagedata") as! data ) btnprofile.frame = cgrect(x: 10, y: 100, width: 100, height: 100) btnprofile.imageview?.contentmode = uiviewcontentmode.scaletofill btnprofile.setimage(img, for: uicontrolstate.normal) if(user_gender == "female"){ btnprofile.setimage(uiimage(named: "femaleprofile_image")?.withrenderingmode(.alwaysoriginal), for: .normal) btnprofile.imageview?.contentmode = uiviewcontentmode.scaletofill } image size 1@-> 40x40 px , 2@-> 80x80 px. please me how solve problem. you should no

android - How to use the fragment's getActivity() method to pass a context? -

i'm working on android app, , gave me these errors avoid non-default constructors in fragments: use default constructor plus fragment#setarguments(bundle) instead and this fragment should provide default constructor (a public constructor no arguments) this code: public afragment newinstance(int sectionnumber, context context) { afragment fragment = new afragment(context); bundle args = new bundle(); args.putlong(arg_section_number, sectionnumber); fragment.setarguments(args); return fragment; } public afragment(context context) { mcontext = context; } how use fragment's getactivity() method pass context ( mcontext = context )? you should never need pass context fragment. you can remove newinstance parameters wherever use context field in fragment, replace getactivity(). if want use field, must assign in onattach , remember unassign when fragment stopped or detached activity

Flask direct responses for streaming and transfer encoding chunked -

flask documentation explains how stream contents of response here possible send large quantities of data client without having keep of in memory. i created sample app using generator , passing response in view function. when make request using curl test view, not see 'transfer-encoding:chunked' header in response. so if flask not sending response in chunks, how streaming code avoiding need have data in memory before sending client?

Select2 : Is it possible to use default translation and noResult key? -

here select2 working fine : $('.select2-customers-search').select2({ language: { noresults: formatnocustomer } }) here default translation : $.fn.select2.defaults.set('language', 'fr'); when remove noresults select2, translation works fine, when add translation not work anymore. is there chance use both ?

python-vlc won't start the player -

ok here go .im trying play video located online.i got url ,which following: http://fsi.stanford.edu/sites/default/files/video_4.mp4 not use in application sample file . reading examples python-vlc module wrote following code: import vlc instance = vlc.instance('--fullscreen') player = instance.media_player_new() media = instance.media_new('http://fsi.stanford.edu/sites/default/files/video_4.mp4') media.get_mrl() player.set_media(media) player.play() in general use anaconda , jupyter write code .in jupyter enviroment code above executes corectly except fullscreen parameter(which still not need).so tried running code on command window expecting vlc player start fullscreen mode.instead code returned 0 expected player never started.im using windows 10 , vlc 2.2.4 . can please explain or @ least me understand why happening ? ok solved on own.i had put infinite loop in end,so player has enough time run: while true: pass

c - error C2059: syntax error :"->" and ";" -

Image
when trying compile program, got these errors: 1>e:\workspace_for_c\02-3\02-3\02-3\02-3.cpp(83): error c2059: syntax error:“new” 1>e:\workspace_for_c\02-3\02-3\02-3\02-3.cpp(84): error c2059: syntax error:“->” 1>e:\workspace_for_c\02-3\02-3\02-3\02-3.cpp(89): error c2059: syntax error:“;” 1>e:\workspace_for_c\02-3\02-3\02-3\02-3.cpp(90): error c2059: syntax error:“->” 1>e:\workspace_for_c\02-3\02-3\02-3\02-3.cpp(105): error c2059: syntax error:“;” my code: note:i using windows 7 vs 2010 it looks have c code you're trying compile if c++, in language new reserved word. change suffix .cpp .c , use of new should not cause problem (although it's bad idea use keywords common programming languages variable names).

reactjs - How to pass in children to parent <Route> component -

Image
i'd define following structure on page: where layout static , contains elements appear on every page, , render page content based on url. to achieve i've defined approutes , layout , about , notfound , used react-router , v4 : approutes.js export default class approutes extends react.component { render () { const supportshistory = 'pushstate' in window.history; return ( <browserrouter forcerefresh={!supportshistory} history={hashhistory} onupdate={() => window.scrollto(0, 0)}> <div> <route path='/' component={layout}> <route path='/about' component={about}/> <route path='*' component={pagenotfround}/> </route> </div> </browserrouter>); }; }; layout.js class navigationpane extends react.component { render() { return (

iOS Interactive Keyboard Reveal -

on facebook messenger ios, has if keyboard hidden, if swipe up, keyboard show. in reverse interactive keyboard dismissal mode: keyboard reveals swipe @ speed in swipe up. does have pointers on how this? edit: answers! looking whether there built-in way this, since saw being done in facebook messenger. however, read blog post said had screenshot system keyboard effect—so i’ll assume there’s no built-in way this! mentioned in comments, i’m using custom keyboard, should lot easier, since have control on frame! basically you'll need uipangesturerecognizer. set uiscreenedgepangesturerecognizer bottom edge, uipangesturerecognizer hiding keyboard in storyboard , drag @ibaction outlets code. set keyboard view container keyboard in bottom of controller in storyboard, user doesn't see it. drag @iboutlet code you'll able modify it's frame. in gesture actions when dragging animate view movement. when stopped dragging need check view's position , animate d

dictionary - How caching of pages use ionic 2? -

can save page status if moved new page? i have map , objects on map. want if map loaded, state saving if moved new page , come back. that's high-loaded process (+ loading image again). use lealetjs thanks! i solved problem follows: i change app architecture - add 2 tabs (list elements page , map markers). , when opened map page use tabs - page loaded , it's ok! explanation of work ionic: if use navctrl.pop() - current page deleted memory. if can not use tabs - use navctrl.push() new before page. , when user want return before page - navctrl.pop() - delete current page, before page cached. is, user's point of view - it's on previous page, , point of view of programmer - new same page being created. and if user wants move before->before page, use navctrl.popto(index of desired page - can use this.navctrl.popto(this.navctrl.getbyindex([yourpagenumber]));

ASP.NET Session gets lost on subsequent request + Visual Studio Web Performance Test -

Image
i have application hosted on local iis. when runing application browser, works fine (actually it's been in production while , haven't received single complain session expiry/loss till date). coming questions. recorded test in vs web performance test , when executing, session on subsequent request not available. while inspecting , matching fiddler traces in both scenario, have same traces still web version works fine. web performance test fails!!! i'm adding screenshots reference... in image above, endpoint - 'upload/saveuploadingmetadata' adds session key 'guid'. next request 'upload/uploadblock?chunk=xxxx' checks if session exists, if processes request else throws exception. when executing behavior browser, succeeds , web performance test, throws error. in image above (for url-'upload/saveuploadingmetadata') can match raw request browser , wpt. in screenshot, won't see asp.net_sessionid cookie believe me it's th

ios - How to make Xcode 8.2.1 show the line that causes an exception? -

i have figured out line of codes caused exception. however, when ran again couple times, highlighted line main class located not actual line caused exception. also indeed, have tried lots of solutions introduced other developers, such go preferences > behavior > exits unexpectedly > choose show line... or click product tab > scheme > edit scheme > check "zombie objects" box or created exception breakpoint on left. whatever did, none of methods above worked. please !!! in advance ! open breakpoint navigator on left side view (seventh icon), click + button on left down corner, select exception breakpoint, choose "all" on "exception" option, catch on break, , run project in debug mode.

powershell - Missing Microsoft Graph ServicePrincipal -

Image
tl;tr creating aad application using microsoft graph api. application has requiredresourceaccess entries 1 requires access microsoft graph. after create application want assign roles service principal using approleassignments object. object requires resourceid objectid (e. g. of microsoft graph) try determine. we using graph api service principals using: https://graph.windows.net/<tenant>/serviceprincipals?api-version=1.6 somehow microsoft graph missing: windows azure active directory microsoft app access panel azure classic portal microsoft.smit office 365 configure windows azure service management api microsoft.supportticketsubmission azure ests service signup microsoft password reset service i need determine objectid of microsoft graph service principal . starting fresh aad, seems there no microsoft graph principal: get-msolservicep

javascript - How to call a REST function from the services.js? -

Image
i got rest function this: @override public string getnameformw() { string mw_url = props.getproperty("mw_url"); //<<this returns string return mw_url.split("/")[3].tostring(); } then have interface: @get @produces(mediatype.text_plain) @path("/getnameformw") public string getnameformw(); then have services.js file, factory located, , there line: var pathformw = $http.get(path + 'getnameformw'); but outcome not string object this: can u me? i need simple string, reed properties file thx deceze, came this var pathformw = $http.get(path + 'getnameformw').then(function successcallback(response) { // callback called asynchronously // when response available pathformw = response.data; } ); that solved problem.... thx again

reactjs - Apollo Graphql mutation with dynamic number of email address -

i have created graphql mutation allows me create staff record. mutation addnewstaff { createstaff(input: { first_name: "test name" last_name: "lname" nickname: "nname" positionid: 10 divisionid: 6 contact_numbers: [ {number: "66643535"} {number: "876876867"} ] emails: [ {address: "testuser@gmail.com"} {address: "gfdsaasd@gmail.com"} ] office_location: "op" }) { id first_name last_name } } the result is { "data": { "createstaff": { "id": "16", "first_name": "test name", "last_name": "lname" } } } the emails , contact_numbers dynamic fields meaning staff can have unlimited number of emails , contact numbers(these stored in separate database tables foreign key staff table). writing frontend code project using

javascript - How to get screenshot of all content of page with protrator.js? -

i going test webpage components library used in project. , want have them visualized on different screen sizes (desktop , mobile) check if conform predefined format (e.g. stacking rules different components). as can't tell size of screen test pages fit to, know: the widths test: 1400, 1024, 600, 480 how specify size of browser window e.g. like in here how make screenshots e.g. like here how make screenshot of particular element e.g. like here question how can make screenshot of content of web page? (not 'visible' part) or how can find height of elements (like height of body) on page adjust height accordingly?

Only in Xcode8.3 get this error 'AppleMach-o Linker Error :Invalid bitcode signature;Linker command failed...' -

Image
this error happen in xcode8.3, in xcode8.2 , xcode7 work fine i had error , managed "fix" making sure opening .xcworkspace file rather .xcodeproj file. confusing because using .xcodeproj had been working fine, stopped - not sure if hit "clean". in project, referencing pods not building. anyway seems fine now! if has more deeper understanding of going on love learn it.

java - Jackson Json to POJO mapping -

i little lost in creating mapping jackson. json has following structure { "d": { "__metadata": { "uri": "https://apisalesdemo8.successfactors.com:443/odata/v2/jobapplication(1463l)", "type": "sfodata.jobapplication" }, "lastname": "k", "address": "123 main street", "cellphone": "12345", "firstname": "katrin", "city": "anytown", "country": "united states", "custappattachment": { "results": [ { "__metadata": { "uri": "https://apisalesdemo8.successfactors.com:443/odata/v2/attachment(1188l)", "type": "sfodata.attachment" }, "fileextension": "jpeg", "filename": "hp-hero-img.j

cordova - Path must be a string. Received undefined while uninstall plugin from ionic 2 -

i using bellow command remove plugin ionic 2 app. cordova plugin remove cordova-plugin-admobpro its display following error. chaitanyas-imac:nearbyapp chaitanya$ cordova plugin remove cordova-plugin-admobpro uninstalling 1 dependent plugins. uninstalling cordova-plugin-extension android uninstalling cordova-plugin-admobpro android uninstalling 1 dependent plugins. uninstalling cordova-plugin-extension ios uninstalling cordova-plugin-admobpro ios error during processing of action! attempting revert... error: uh oh! path must string. received undefined how can resolve this?

pdfbox - How do I make modifications to existing layer(Optional Content Group) in pdf? -

i implementing functionality allow user draw figures in pdf. want draw figures in single layer, can made visible or invisible user.i able create new layer in pdf. able retrieve layer.but, not able make modification layer (pdoptionalcontentgroup). tried converting pdoptionalcontentgroup pdpage , making desired changes pdppage. saved pddocument.it created layer same name previous one, changes not there.here code used: pdfont font = pdtype1font.helvetica; pddocument doc = pddocument.load(src); pdoptionalcontentproperties ocprops = doc.getdocumentcatalog().getocproperties(); foreach (string groupname in ocprops.getgroupnames()) { pdoptionalcontentgroup group = ocprops.getgroup(groupname); cosbase cosbase = group.getcosobject(); pdpage grouppage = new pdpage((cosdictionary)cosbase); pdpagecontentstream cs = new pdpagecontentstream(doc, grouppage, true, false); cs.begintext(); cs.setfont(font, 12); cs.movetextpositionbyamount(150, 200); cs.drawstring(&qu

amazon web services - AWS SDK for PHP - Fatal Error Issue -

i trying connect s3 upload file via server whenever try run php, encounter following error below. included version , region yet issue still stands? error: fatal error: uncaught exception 'invalidargumentexception' message 'missing required client configuration options: region: (string) "region" configuration value required "s3" service (e.g., "us-west-2"). list of available public regions , endpoints can found @ http://docs.aws.amazon.com/general/latest/gr/rande.html. version: (string) "version" configuration value required. specifying version constraint ensures code not affected breaking change made service. example, when using amazon s3, can lock api version "2006-03-01". build of sdk has following version(s) of "s3": * "2006-03-01" may provide "latest" "version" configuration value utilize recent available api version client's api provider can find. note: using 'la

git - How to verify the correct size of a cloned repo from GitHub? -

my question how verify actual size of cloned repository, comparing size on github, automatically check if repo has been downloaded correctly. the problem size given github api not match size of cloned repo. here's do: i repository size using github api $ echo https://github.com/jemole/drscratch | perl -ne 'print $1 if m!([^/]+/[^/]+?)(?:.git)?$!' | xargs -i curl -s -k https://api.github.com/repos/ '{}' | grep size output: "size": 55617, i clone repository , calculate size of downloaded folder $ git clone https: //github.com/jemole/drscratch $ du -s drscratch output: 69104 drscratch/ thanks! the size of git repo vary, since there no canonical way git store data (at least there single objects vs. pack files, pack files might different between different repos -- size of local git repo before , after call git gc ). can't use size measure correct download. you can check local repo call git fsck , command walks t

html5 - How to display message on pattern validation? -

i added pattern attribute template <input class="form-control" type="text" id="elementname" [(ngmodel)]="elementname" name="elementname" (input)="onelementnamechanged()" #name="ngmodel" required pattern="[a-za-z0-9_)*\s]*" > how add message display if input not correct? something wont work: <div [hidden]="!name.errors.pattern" class="alert alert-danger"> name must match pattern </div> i advise use reactiveforms instead of templatedrivenforms manage validation patterns , messages. an html snippet example : <form novalidate [formgroup]="user" (ngsubmit)="onsubmit()"> <div formgroupname="account"> <md-input-container> <input md-input type="text" placeholder="{{'user.email' |

html - Container not expanding height to fit content -

Image
i tried work flexboxes having trouble it. as display small, content either overflows nested flexbox or (while tried fix myself) nested flexbox overflows main flexbox. html, body, .viewport { width: 100%; height: 100%; margin: 0; font-family: 'open sans', sans-serif; font-size: 11pt; } body { display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; } header, article, section, footer { padding: 2em; } header { background-color: red; } article { background-color: aqua; -webkit-flex: 1; flex: 1; } section { background-color: yellow; display: flex; flex-direction: row; flex-grow: 1; } .offer { background-color: cornflowerblue; border: 1px solid black; } footer { background-color: forestgreen; } <header> header </header> <article> article </article> <section> <div class="offer"&g

graph databases - Neo4j - Traversing from one node to another which are indirectly connected by parent Node -

i have specific case have 2 labels person , company. person has 2 nodes x , y , company has single node. both persons have relationship company has_employee. i want find relationship between x , y i.e. work same company. how in neo4j? given nodes x , y? this depend on if you're looking specific connection (via :company node), or looking connection @ all. let's :person nodes have name, , person nodes x , y have names 'x' , 'y', can match them. let's have index on :person(name) can lookup nodes quickly. if query want "do persons x , y share same company", query this, returning company in question, is: match (x:person{name:'x'})<-[:has_employee]-(comp:company)-[:has_employee]->(y:person{name:'y'}) return comp but if don't know how these persons connected, or if they're connected, we'll want run shortestpath() match between nodes, , see connects them. it helps set upper bounds match. let'

apache - laravel right server configuration for host several site -

i got laravel project uploaded on vps, can't understand how configure things have: more 1 site(laravel project) on vps; (that is tricky, because configuration examples i've found talking pointing root of server public laravel's folder) having .env , .composer , system folders not accesible directly; wich right user , permission set on various folders; in system ive : www-data classic apache group standard privileges; a non root user, used access mysql , ftp service; a root user; i'm using apache2 on ubuntu server 16.04. according question, assume want host multiple laravel sites on vps without messing up! here go! let's assume create directories of site in /var/www directory because it's basic apache directory be. configuration site 1 : ->virtual host site 1 <virtualhost *:80> documentroot "var/www/site1/public" servername www.site1.com # other directives here </virtualhost> -> directory

c# - Sitecore: Saving images in media library from url -

to download , save image in media library using following code. can see item created in media library has no media. using (webclient webclient = new webclient()) { byte[] data = webclient.downloaddata("https://myurl/images?id="+12345); stream memorystream = new memorystream(data); var options = new sitecore.resources.media.mediacreatoroptions { filebased = false, overwriteexisting = true, versioned = true, includeextensioninitemname = true, destination = factory.getdatabase("master").getitem(settings.getsetting("profilepicturesfolderitemid")).paths.path + "/" + "12345", database = factory.getdatabase("master"), alternatetext = userprofileitem.name }; using (new securitydisabler()) { var creator = new sitecore.resources.media.mediacreator(); creator.createfromstream(memorystream, v1imageid, options); } } in media fo

javascript - AngularJS returning to html from http -

this question has answer here: how return response asynchronous call? 21 answers why angular $http success/error methods deprecated? removed v1.6? 2 answers angularjs error .success not function 4 answers i'm trying return angular function html success function of http request. in case, i'm using google api miles, want return html won't return unless it's in main function. this code in controller : $scope.getdistance=function(pcodefrom,pcodeto,id){ if($scope.milesgot.indexof(id) == -1) { //if not done request once $scope.milesgot.push(id); var url = 'mylinktogooglematrixapiishere'; $http({method: 'get', url: url}).success(function(data) {

reactjs - react-router causing reload whenever the history state pops -

i have been stuck in problem long time, need on one. have page has set of questions come 1 1, answer 1 want push in history state if in mobile device press browser go previous question, , when set of questions end want clear history. the approach trying out pushing @ first time , replacing state afterwards. when press back, react router reloads page. i using react-router-redux along react router. window.history.pushstate(stateobj, 'some-title', ''); window.addeventlistener('popstate', this.prev);

node.js - VSCode Windows stops npm -

i have lite-server (2.3.0) running on vscode integrated terminal on mac , have integrated terminal running gulp , publishing dist folder lite-server serving from. whenever on mac works nicely , browser refreshes , lite keeps running. when running same process on windows machine lite-server process crashes getting: code elifecycle errno 1 and error seems be: events.js:163 throw er; // unhandled 'error' event ^ error: eperm: operation nor permitted, lstat i have: npm 4.4.1 node 7.8.0 vscode (running admin far know) 1.10 angular 4.0.1 it looks me permission issue have run separate cmd admin , same behavior. any ideas?

javascript - Event binding on dynamically created elements? -

i have bit of code looping through select boxes on page , binding .hover event them bit of twiddling width on mouse on/off . this happens on page ready , works fine. the problem have select boxes add via ajax or dom after initial loop won't have event bound. i have found plugin ( jquery live query plugin ), before add 5k pages plugin, want see if knows way this, either jquery directly or option. as of jquery 1.7 should use jquery.fn.on : $(staticancestors).on(eventname, dynamicchild, function() {}); prior this , recommended approach use live() : $(selector).live( eventname, function(){} ); however, live() deprecated in 1.7 in favour of on() , , removed in 1.9. live() signature: $(selector).live( eventname, function(){} ); ... can replaced following on() signature: $(document).on( eventname, selector, function(){} ); for example, if page dynamically creating elements class name dosomething bind event parent exists, document . $(document

vb.net - WCF client side authentication -

i'm totatally newby in consuming wcf services... reading "professional wcf 4 windows communication foundation .net 4" more server base related client consuming... so, have connect web service post data , response performed action... i had wsdl address reference (obviously user name , password) no additional info/docs... in vb 2012, referenced web reference , got proxy built... config is <?xml version="1.0" encoding="utf-8"?> <configurationsnapshot xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns="urn:schemas-microsoft-com:xml-wcfconfigurationsnapshot"> <behaviors /> <bindings> <binding digest="system.servicemodel.configuration.basichttpbindingelement, system.servicemodel, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089:&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?

ds 5 - how to find the process/thread waiting for I/O or CPU contention in DS-5 Streamline -

in ds-5 streamline if enable linux cpu i/o wait performance counter, can see in timeline when there cpu i/o wait. how find out exact thread or process waiting i/o. there many processes running on target device. how find exact thread waiting i/o.

oracle11g - Eclipse with WebLogic 11g show wrong server status when starting -

i have eclipse neon release (4.6.0) weblogic server 11gr1(10.3.5). i'm having trouble starting server , publishing .wars eclipse server tab. problem server remains stuck in starting @ 98% although in console shows started. <weblogicserver> <bea-000360> <server started in running mode> the weblogic console localhost:7101/console works means server indeed started. problem in eclipse server tab still shows ...starting , guess it's problem eclipse "reading" improperly server state. i cannot publish application servers tab in eclipse because of this. it worked untill , didn't change in it's configuration.

excel - reporting CA per month for each customer in VBA -

Image
i should have ca/month/customer in vba period between a1 , c1 can me giving me steps? first second.. or giving me advice? use functions. no need vba that.

YII 1 how to use multiple database in one application and one single login -

yii 1. i have multiple database ex: db_company_a , db_company_b same structure , table , in every database have tbl_user , in tbl_user have company_id. question how use single page login , redirect based on user login? i have follow doesnt work here !