Posts

Showing posts from March, 2011

c# - MEF - Get assembly from embedded DLL -

i using mef create "plugins" wpf application. of these plugins want embed directly exe file exe needs standalone. using costura fody embed resource along other references. exe file needs standalone unable create directory these plugins , use directoycatalog is there anyway can either load assembly embedded resource, or specify assembly name such as: catalog.catalogs.add(new assemblycatalog("my.assembly.name)); i have tried looping through manifest resources these appear zipped fody: var resourcenames = gettype().assembly.getmanifestresourcenames(); foreach (var resourcename in resourcenames) any help/suggestions appreciated. ok got work me, using class below (found code @ https://github.com/sebazzz/entityprofiler/blob/master/src/ui/entityprofiler.viewer/appbootstrapper.cs , tweaked suit needs): to use call extract function find costura zip files in resource manifest , decompresses , registers it. the function returns dictionary of

c# - How to increase speed in sql string when insert to ms access datebase -

i have text file, size 3mb(15,000 strings), inserted text file. processing takes 30 minutes. how can increase speed of ms access database.and want progress bar, if it's processing long. openfiledialog ofd = new openfiledialog(); if (ofd.showdialog() == dialogresult.ok) { filestream fs = file.openread(ofd.filename); bufferedstream bs = new bufferedstream(fs); streamreader sr = new streamreader(bs); { metroprogressbar1.maximum = convert.toint32(sr.length); (int = 0; < sr.length; i++) { metroprogressbar1.value++; } string s; while ((s = sr.readline()) != null) { try { string pattern = @"[\d]{1,8}([.,][\d]{1,4})

hadoop - Apace Drill reading gz and snappy performance -

Image
i'm using apache drill 1.8. , test porpoise made .csv 2 parquet files. csv 4gb big, parquet gz codec 120mb , second parquet snappy codec 250gb big. as spark using snappy default codec, , snappy should performance faster face 1 problem. this files block size , etc on hadoop: with snappy codec: with gz codec: time when i'm trying query in drill (which have default snappy codec) parquet files on snappy codec around 18seconds. time when i'm trying query in drill parquet files on gz codec same query around 8seconds. (it's simple query select 5 columns, ordering 1 , limiting on one) i'm little confused now. isn't snappy more efficient i/o? making mistake somewhere or how works. if explain me super grateful because couln't find useful on net. thank once more!

Inner Join Returning No Results MS SQL Server -

i have 2 tables containing geographical data. want inner join table1 table2 of table1 field table2. when tried following: select a.*, b.field table1 inner join table2 b on (cast(a.latitude float) = cast(b.latitude float)) , (cast(a.longitude float) = cast(b.longitude float)) i met no results, have checked there same exact pairs of lat longs in both tables. as check, joined latitudes, longitudes , had results, seems problem having both latitudes , longitudes joined. joining on floating point numbers wrong thing do. nice if sql parse returned warning when 1 attempts this. problem floating point numbers can same, different in last bit. first, try using native types (which should decimal or character): select a.*, b.field table1 inner join table2 b on a.latitude = b.latitude , a.longitude = b.longitude ; if doesn't work, can use logic this: select a.*, b.field table1 inner join table2 b on a.latitude between b.latitude - 0.00

angularjs - Angular JS Templating -

i have template set view pages load using app.route('/*').get(core.renderindex); where , renderindex function looks exports.renderindex = function (req, res) { res.render('modules/core/server/views/index', { user: req.user || null }); }; now when route has announcement in render different template , not index.server.view.html app.route('/:shopid/:locationid/announcement/*').get(core.renderannouncement); exports.renderannouncement = function (req, res) { res.render('modules/core/server/views/announcement', { user: req.user || null, }); }; the reason why i'am doing because need change meta tags on page i.e. need set variables on view before page renders comes controller. my question how can access variables in server.view.html file? <!doctype html> <html lang="en" ng-controller="offercontroller" ng-init="getannouncement()"> <head> <meta charset="utf-8&

javascript - One Root-Element or the whole layout in ReactDOM.render()? -

so i'm learing react.js , wondering, if it's better have reactdom.render() (current status): reactdom.render( <div classname="container"> <div classname="row"> <div classname="twelve columns"> <header /> </div> </div> <div classname="row"> <div classname="six columns"> <sidebar /> </div> <div classname="six columns"> <posts data={posts}/> </div> </div> </div>, document.getelementbyid('content') ); or better have root element following: reactdom.render( <mypageroot />, document.getelementbyid('content') ); and add layout stuff (row, cols, etc) render()-method of mypageroot? the first way not give opportunity define component state, or hook lifecycle events. also, first way become long application grows.

angularjs - Angular $http callbacks not working for HTTP 304 in Chrome -

i encountering problem angular 1.5 , not find similar question via google. welcome change, problem not exist in ie, happens in latest version of chrome. when approach json api , send same get request twice in row, first request returns 200 ok , second returns 304 not modified . doing request 'cache-control': 'no-cache' simulate how our (generated) api client performs requests. cache control enabled , both requests executed correctly (see f12) , program terminates. cache control disabled , both requests executed correctly (f12) program not terminate. is bug in chrome, or bug in angular's $http , or missing crucial detail? thanks time! minimal example on jsfiddle output: hi sending request 1 http://jsonplaceholder.typicode.com/posts/1... success 1! resolved 1! sending request 2 http://jsonplaceholder.typicode.com/posts/1... fixed after chrome update. body must @ least 30 characters.

AngularJS: ng-repeat track by obj.id doesn't reinitialise transcluded content when obj.id changes -

function componentcontroller() { var vm = this; this.$oninit = function() { vm.link = 'http://example.com/obj/' + vm.obj.id; } } function maincontroller($scope, $timeout) { $scope.arrobjs = [{id: 1, name: "object1"},{id: 2, name: "object2"}]; console.log('object1\'s id ', $scope.arrobjs[0].id); $timeout(function() { // simulates call server updates id $scope.arrobjs[0].id = '3'; console.log('object1\'s new id ', $scope.arrobjs[0].id, '. expected link above updated new id'); }, 1000); } var somecomponent = { bindings: { obj: '=' }, template: '<div>url: <span>{{$ctrl.link}}</span></div>', controller: componentcontroller }; angular.module('myapp', []); angular .module('myapp') .controller('maincontroller', maincontroller) .controller('componentcontroller', component

php - Execute multiple SQL queries and sort the output -

currently, i'm working on project requires me execute 2 sql queries, have sort output date , id before writing output of both queries table. sorting both queries in sql : order order.date desc, order.id desc. then appending results in 1 variable gets looped on part of script. executing seperate queries result in 2 blocks of sorted items not sorted when appending results. what solution data sorted properly? try use select a.* ((query1) union (query2)) order a.date desc, a.id desc

php - Error Renaming Files and folders codeigniter -

i new codeigniter, had rename files , folders project, used notepad++ , minunciosamente changed names, did 3 times, appears me message: unable load requested file: header.php where problem? if can me i'm grateful. check controller method , see file being called it header.php ci case sensitive if file in folder in viewfolder then load folder/file it methods file name changed but file name still same or vice versa.

polymer - Value of paper-tags-dropdown -

this kind of absurd, cannot find anywhere how retrieve selected tags custom polymer element paper-tags-dropdown what missing? i've spent hour on this, cannot find using google. find hard believe skipped in docs. finally figured out myself. added on-iron-select event paper-tags-dropdown element, , in event handler can use e.target.selecteditems, e event. way can store selecteditems later use, when submitting form. however, have liked able @ end, when submitting form. guess now.

sapui5 - How to get SCI(SAP Cloud Identity) account info in HCP portal service? -

i building html5 application in hcp, using portal service manage roles. back-end develper ask me give them role info (id or e-mail) input of interface(they need authentication info). how ? there front-end api provided these info? thanks in advance. user api provides few details user in hcp . use user api in html5 application, add route neo-app.jso n application descriptor file follows: "routes": [ { "path": "/services/userapi", //application path forwarded "target": { "type": "service", "name": "userapi" } } ] a sample url route defined above this: /services/userapi/currentuser . an example response return following user data: { "name": "p12345678", "firstname": "jon", "lastname": "snow", "email": "jon.snow@tina.com", "displayname": "jon snow (p12

api - Is slack team id unique or not? -

i'm making slack bots on computer , trying store team id database. i want know slack's team id unique or not. i trying find on slack docs.. got nothing. anybody knows it? while user ids , channel ids aren't totally unique (they unique team contains them), team ids principal organizing force throughout slack , indeed unique. you'll never find 2 separate slack teams same team id.

Docker: Swarm worker nodes not finding locally built image -

maybe missed something, made local docker image. have 3 node swarm , running. 2 workers , 1 manager. use labels constraint. when launch service 1 of workers via constraint works if image public. that is, if do: docker service create --name redis --network my-network --constraint node.labels.myconstraint==true redis:3.0.7-alpine then redis service sent 1 of worker nodes , functional. likewise, if run locally built image without constraint, since manager worker, gets scheduled manager , runs well. however, when add constraint fails on worker node, docker service ps 2l30ib72y65h see: ... shutdown rejected 14 seconds ago "no such image: my-customized-image" is there way make workers have access local images on manager node of swarm? use specific port might not open? if not, supposed - run local repository? the manager node doesn't share out local images itself. need spin registry server (or user hub.docker.com). effort needed isn'

javascript - How to exit phantom if it hangs on page.open (with example) -

var system = require("system"); var page; // user supplied url var myurl = system.args[1]; // var myurl = 'https://waffles.ch/'; page = require('webpage').create(); // suppress errors output page.onerror = function(msg, trace) {}; // 5 seconds page.settings.resourcetimeout = 5000; // page.settings.javascriptenabled = false; page.open(myurl, function(status) { //hack page.open not hooking phantom.onerror settimeout(function() { if (status !== "success") { console.log(myurl); phantom.exit(); throw new error("unable access network"); } else { var pagetitle = myurl.replace(/http.*\/\//g, "").replace("www.", "").split("/")[0]; var filepath = "img/" + pagetitle + '.jpg';

java - How to replace N-number of matches in the string? -

this question has answer here: in matcher.replace method,how limit replace times? 1 answer so, how in groovy (or java)? this: somestring.replacen(/(?<=\p{l}) (?=\p{l})/, '', 3) // replace first 3 matches for now, came stupid solution: (0..2).each { s = s.replacefirst(/(?<=\p{l}) (?=\p{l})/, '') } in other languages it's easy pie: python - subn(count=3) php - preg_replace(limit=3) rust - regex.replacen i think after is 3.times { s = s.replacefirst(/(?<=\p{l}) (?=\p{l})/, '') } or if need more can add method string class like string.metaclass.replace << { pattern, replacement, n -> def result = delegate n.times { result = result.replacefirst pattern, replacement } result } somestring.replace(/(?<=\p{l}) (?=\p{l})/, '', 3)

apiblueprint - How can I hit a local dev server from UI generated by apiary command line tool -

Image
i using apiary preview --server watch file while editing , have ui generated. i hit local dev server in "try" section of ui, when hit "call resource", request made post https://jsapi.apiary.io/apis/null/http-transactions/ . host set http://localhost:3050 , i'm expecting hit endpoint. how can change this? $ apiary version 0.5.2 currently, console calls routed via apiary.io servers work around cors limitations. if published, can work around limitation exposing local port using service such ngrok . there testing of version of console make calls api directly , utilise browser plugin if needed around cors limitations. should able utilise them soon.

mysql - Wordpress setup latency on Azure -

i have wordpress environment setup on azure. front end on webapp (size s2 - 2 cores & 3.5 gb ram) whilst db on 2 replicated classic virtual machines (size f2 - 2 cores / 4 gb memory). we tried connecting web app vms on point-to-site vpn in nutshell vpn 1 azure service (webapp) (vms), connection still being made on internet. i'm looking ways improve network latency between azure's webapp , virtual machines. firstly, if trying "improve" network latency have issue somewhere else. please provide more details on latency issue. you should pushing towards arm stuff now. if want improve performance can try using azure service fabric.

vba - VB script into SQL (VB making 2 inserts into one column) -

i'm new coding pls take easy on me. i'm rewriting visual basic sql. the vb code inserts transformed data file tabley . want sql code load data tablex , transform , load tabley . created tablex , inserted untransformed data file. want transform , insert tabley when notice problem. here vb code if some-if-statement dtsdestination("max") = mid(dtssource("col001"),985,5) mid mid mid dtsdestination("max") = mid(dtssource("col001"),983,5) here sql version: insert tabley (max, aaa, bbb, ccc, max) select substring(col001,985,5), substring, substring, substring, substring(col001,983,5) tablex some-where-statement the problem i'm trying insert 2 values [substring(col001,985,5) , substring(col001,983,5)] 1 column. sql gives me error: the column name 'max' specified more once in set clause or column list of insert. column cannot assigned more 1 value in same clause. mo

javascript - Angularjs $http interceptors - Cannot generate call to requestError -

i'm using $http interceptors capture events following ajax submission. reason, not able throw requesterror . i've set test app try , call requesterror , far can multiple responseerrors . from angularjs docs: requesterror : interceptor gets called when previous interceptor threw error or resolved rejection. this test code. .factory('httpinterceptor',['$q',function(q){ var interceptor = {}; var uniqueid = function uniqueid() { return new date().gettime().tostring(16) + '.' + (math.round(math.random() * 100000)).tostring(16); }; interceptor.request = function(config){ config.id = uniqueid(); console.log('request ',config.id,config); return config; }; interceptor.response = function(response){ console.log('response',response); return response;

azure - C# Programatically allow user to access AD Application -

i have quite strange situation. basically have app registered in azure. need set 'require user assignment' option in ad fine. however, once particular step completed hr department on app, need allow user access app. possible @ all? i know quite strange request cannot seem find on google (could googling wrong terms) surprise me if wasnt possible @ all.

meteor - How To Structure Dynamic MongoDb Query -

please trying wrap head on how query collection dynamically. have collection has below schema. tripart_property_schema = new simpleschema({ "type" : { type : string, label : 'property type', }, "sale_lease" : { type : string, label : '', }, "location" : { type : object, label : '', optional : true }, "location.state" : { type : string, label : 'state', }, "location.lga" : { type : string, label : 'lga', optional : true }, "location.address" : { type : string, label : 'address', optional : true }, "amount" : { type : object, label : '', optional : true }, "amount.amount" : { type : number, label : '',

javascript - Unable to upload audio to the server -

i able upload audio locally. uploading audio server not working. code is: module.exports.uploadaudio = function (req, res) { var form = new multiparty.form(); form.parse(req, function (err, fields, files) { console.log("audio_path=======>>>> " + json.stringify(files.file[0].path)); cloudinary.uploader.upload(files.file[0].path, function (result) { console.log(result); obj.key2 = result.url; res.send({ result: result, serverstatus: 200, response_message: "audio uploaded" }); }, { resource_type: "auto" }) }) }

asp.net web api - WebRequest POST json parameter showing as Null on WebAPI -

i have webrequest executing through windows ce project. able send through , able see hitting webapi. issue when request comes through, parameter null. web api [route("")] public ihttpactionresult post([frombody] stopinfo stopinfo) { try { _scannerservice.addstops(stopinfo); return ok(stopinfo); } catch (exception ex) { //return request.createerrorresponse(httpstatuscode.badrequest, ex); return null; } } webrequest private void btnupload_click(object sender, eventargs e) { stopinfo s1 = new stopinfo(); s1.contactname = "test"; s1.companyname = "ignite"; s1.city = "katy"; s1.addr1 = "22908 mountain view"; s1.addr2 = "suite 300"; s1.state = "tx"; s1.zip = "77449"; string uploadurl = txtservertext.text + "/api

grep - R: Error in nchar(b64String) : invalid multibyte string, element 1 -

i using illuminaio::readidat read idat files. library(illuminaio) dat <- readidat('1552034262_a_grn.idat') error in nchar(b64string) : invalid multibyte string, element 1 in addition: warning messages: 1: in grep(" __", r) : input string 47890 invalid in locale 2: in grep(" __", r) : input string 47891 invalid in locale 3: in grep(" __", r) : input string 47892 invalid in locale 4: in grep(" __", r) : input string 47893 invalid in locale 5: in grep(" __", r) : input string 47894 invalid in locale 6: in grep(">", r) : input string 47890 invalid in locale 7: in grep(">", r) : input string 47891 invalid in locale 8: in grep(">", r) : input string 47892 invalid in locale 9: in grep(">", r) : input string 47893 invalid in locale 10: in grep(">", r) : input string 47894 invalid in locale this sessioninfo(): r version 3.3.1 (2016-06-21) platform: x86_64-pc-l

git - How to manage configuration files when collaborating? -

i'm writing short script few simple variables @ top of page. want work on them friend, aren't sure how manage variables needing changed after pulling each time 1 of us, adding unnecessary junk git status. thought creating different named branches each of us, , master have example usernames set, seems silly have work merging. have variables passed script options, isn't desired, nor separating out separate configuration file. great have .gitignore ignore few lines in file. how can elegantly managed? how problem managed? you can't ignore changes particular lines of file, i'm afraid, you're stuck having separate configuration file. below i've listed 2 typical ways of dealing this, , 1 more exotic one: have sample configuration file in git here, keep file config.sample in git example, application use values in file config in .gitignore . application produce error unless config present. have remember change values in sample file when add n

uml - How to represent the admin in this case? -

Image
the admin able same user, , see , modify tickets not theirs. normal users can on tickets have created. difference admin gets list of tickets, while users list of own tickets (the "show tickets" extension). differences between user , admin. how represent admin? adding actor , connecting doesn't seem idea. each of ticket related use cases have condition "user created ticket.", adding "or user admin" pretty job, wouldn't clear system has admin. problem admin user 1 additional permission. while isn't directly explained in uml specification, can add user admin, show generalization between actors admin specialization of user , link ucs can performed admin admin actor while ucs available user (and admin) user actor. a specialized actor has access (can run) ucs of actor specializes plus own ucs. such approach suggested e.g. howard podesva (see "uml business analysts") , compliant uml specification. note association

android - Whats wrong with this retrofit call? -

im trying send post , build response using retrofit android. i have managed send no problems need send post body elements. public static <s> s createaccessservice(class<s> serviceclass, string code, string redirecturi, string clientid, string clientsecret) { okhttpclient.builder httpclient = new okhttpclient.builder(); string basiccredentials = clientid+":"+clientsecret; byte[] encodebytes = base64.encode(basiccredentials.getbytes(), base64.no_wrap); httpclient.addinterceptor(new interceptor() { @override public response intercept(chain chain) throws ioexception { request original = chain.request(); requestbody body = new formbody.builder() .add("grant_type", "authorization_code") .add("code", code) .add("redirect_uri", redirecturi).build(); request request

jquery - Stage positioning issue with ScrollMagic -

i created animation using greensock , scrollmagic working great, can't figure out how adjust initial position of stage/graphics (before user triggers animation). currently, calling .setpin method on container element class of 'stage'. stage element inside of larger parent container (#how-it-works) triggerelement animation: var scene = new scrollmagic.scene({triggerelement: "#how-it-works", duration: 4000}) .setpin(".stage") .addto(controller) .settween(scrollanimation); the issue i'm having stage element "stuck" @ top of parent container, , vertically centered within parent container prior animation being triggered. tried adjusting 'top' css property on .stage element, required me use !important , produces strange results. there parameters/arguments control positioning of pinned element in scrollmagic? here's codepen animation - http://codepen.io/billkroger/pen/bwnxzv (make sure scroll down) any appreci

java 8 - Using generics to share a common method with multiple arguments -

i finding have method able accept 2 types of list<> objects. example: public void foo(long id) {}; the above function called on multiple objects each of whom have either id of type long or integer. what's happening objects have id defined long, method call works fine: class bar {long id} bar test = new bar(1l); foo(bar.id); but objects have integer id, have first convert integer long before using foo. can of course have new method takes in integer id rather not that. way generics? no. can't define type "or" of 2 types. however, can accept number , includes both long , integer types, , use longvalue() method: public void foo(number number) { long id = number.longvalue(); // rest of code stays same }

go - How do I retain the outer XML of sub-elements? -

i have xml file contains list of individual <order/> elements. split single xml file multiple files, each of contain single order. example input file: <orders> <order order-id="123"> <line-item product-id="abc">abc</line-item> </order> <order order-id="456"> <line-item product-id="def">def</line-item> </order> </orders> desired outputs: order-123.xml: <order order-id="123"> <line-item product-id="abc">abc</line-item> </order> order-456.xml: <order order-id="456"> <line-item product-id="def">def</line-item> </order> at stage, not concerned unmarshalling each of order details struct; merely want exact copy of each <order/> node in own file. i have tried few variations of using xml:",innerxml" , like this : type ordersraw s

vba - Looping through Excel Cells and writing them to Word -

i using macro in excel loop through cells , write data template in word. worked fine until wanted add more cells grab data from. still works fine except once variable have name "j" gets value of 25, error saying "run-time error '5941': requested member of collection not exist." i've played around using different rows , columns , every combination works. when " j " reaches 25 error occur. failing when reaches wrd.activedocument.tables(1).rows(j) ... line. sub label_exceltoword_single() 'variable stores file path 'word template dim strpath string strpath = cells(28, 8) 'opens microsoft word edit template call openword set wrd = getobject(, "word.application") wrd.visible = true wrd.activate wrd.activedocument.close savechanges:=false wrd.documents.open strpath 'variables used loop data manipulation dim k integer dim j integer k = 1 j = 1 &#

php - MpdfException IMAGE Error () : Error parsing image file - Yii2 -

i'm stuck in awkward situation images being shown in local environment while generating pdf. but, not in production. images being displayed [x] when generate pdfs mpdf. after inserting $mpdf->showimageerrors = true; in controller . public function actionexportcasespdf($id) { . . . . $mpdf = new \mpdf(); $mpdf->showimageerrors = true; $mpdf->writehtml($output); $mpdf->output($filename, 'd'); } error mpdfexception image error (..17.jpg): error parsing image file - image type not recognised, , not supported gd imagecreate even, gd library installed in server using apt-get install php5-gd command. and, image path used correct. i tried keep image source such. but, no luck. <img src="<?= \yii\helpers\url::to('@web/images/logo.png', true) ?>" width="100" alt="logo" /> i searched , tried solution given these links. but, still no luck : images not showing on production

python - Urllib problom: AttributeError: 'module' object has no attribute 'maketrans' -

the environment win10 64-bit, python 2.7.12, anaconda. code quite simple web-scrapy: import urllib fhand = urllib.urlopen('http://www.reddit.com') line in fhand: print line.strip() and result weird: 0.8475 traceback (most recent call last): file ".\catch-web.py", line 1, in <module> import urllib file "c:\users\xxx\anaconda2\lib\urllib.py", line 30, in <module> import base64 file "c:\users\xxx\anaconda2\lib\base64.py", line 98, in <module> _urlsafe_encode_translation = string.maketrans(b'+/', b'-_') attributeerror: 'module' object has no attribute 'maketrans' the code run on other pc ipython, not work on one. have re-installed anaconda several times, failed. i appreciate if solve it. try spyder, works. still no idea problem.

how to make right button of react native drawer? -

Image
i made right menu using react-native-drawer. can't move left button right side marked in above picture. there way it? assuming you're using nav bar built react-native-router-flux can write own custom navbar . can reference their navigation component if need in doing so. give control put hamburger icon on right. component navbar reference @ follows when define router. <router navbar={navbar} ... />

Save image in specific resolution in Matlab -

i'm trying hours output plot in specific resolution (320x240). xmax = 320; ymax = 240; xmin = 0; ymin = 0; figure; set(gcf,'position',[1060 860 320 240]); axis([xmin,xmax,ymin,ymax]); plot(somelinesandpointsintherange320x240); saveas(gca,outname,'jpg'); export_fig(outname); where saveas output jpg image in arbitrary resolution. export_fig still showing axes. adding axis off or axis tight doesn't either. has idea? update: problem solved. completeness here current solution: xmax = 320; ymax = 240; xmin = 0; ymin = 0; figure; set(gcf,'position',[1060 860 320 240]); subaxis(1,1,1, 'spacing', 0.01, 'padding', 0, 'margin', 0); % removes padding axis([xmin,xmax,ymin,ymax]); plot(somelinesandpointsintherange320x240); axis([xmin,xmax,ymin,ymax]); set(gca,'xtick',[],'ytick',[]); % removes axis notation = frame2im(getframe(gcf)); %convert plot image (true color rgb matr

asp classic - ASP Session variables and array assignments -

i have question session variables , array assignments. i have 2 dimensional array 10 rows , 20 columns. example 1 not work , example 2 works: example 1: session('anar')(5, 10) = 'ab' response.write '<br>the new value ' & session('anar')(5, 10) the new value of session('anar')(5, 10) printed empty string. example 2: dim localar: localar = session('anar') locarar(0)(5, 10) = 'abc' session('anar') = localar response.write '<br>the new value ' & session('anar')(5, 10) now update session ('anar')(5, 10) has been done. although works, think problem session('anar') first copied localar , localar copied session('anar') . could expert tell me please if there way modify session('anar')(5, 10) without copying of session array local array? unfortunetaly there's not. have use local arrays. from session object (iis) if store

How to open Facebook profile in Android app with numerical user-id -

i want open person's facebook profile in native android app given numerical user id. note not referring vanity url www.facebook.com/person.name.7 . i've tried seemingly every url scheme including following no luck: fb://page/426253597411507 fb://profile/426253597411507 fb://facewebmodal/f?href=https://www.facebook.com/426253597411507 https://www.facebook.com/n/?426253597411507 does know url scheme works? or way vanity url profile id? in case loading users profile picture using below code hope may you. picasso.with(main.this).load("https://graph.facebook.com/" + facebookuserid + "/picture?type=small").resize(80, 80) .into(fbpicimageview);

java - Is it problematic to assign a new value to a method parameter? -

eclipse has option warn on assignment method's parameter (inside method), in: public void dofoo(int a){ if (a<0){ a=0; // generate warning } // stuff } normally try activate (and heed) available compiler warnings, in case i'm not sure whether it's worth it. i see legitimate cases changing parameter in method (e.g.: allowing parameter "unset" (e.g. null) , automatically substituting default value), few situations cause problems, except might bit confusing reassign parameter in middle of method. do use such warnings? why / why not? note: avoiding warning of course equivalent making method parameter final (only it's compiler error :-)). question why should use keyword "final" on method parameter in java? might related. for me, long , clearly, it's fine. say, doing buried deep in 4 conditionals half-way 30-line function less ideal. you have careful when doing object references, since calling methods on

oop - Access property from component in provider in angular2 -

so i'm new oop , trying out ionic 2 angular 2 typescript. have input in home.html file coupled username in home.ts this: export class homepage { public username: string; public newusername: string; ... constructor(public users: userservice) { ... now want service (userservice.ts) take username input or home.ts , modify , store result newusername. do have make constructor in service/provider in homepage instantiates new object of home though made object of in home.ts? i imported homepage in userservices cant access newusername because didnt make object of it. i don't know want take @ if you. (i'd use newusername in service itself) note : has nothing ionic2 don't know ionic2 . working demo : https://plnkr.co/edit/03oxutzywrro8ptfdfla?p=preview import { component } '@angular/core'; import {service} './service'; @component({ selector: 'my-app', template: ` new user : {{s.newusername}}<br> <input type=&qu

c++ - Non instantaneous/jerky movement using SDL2 & OpenGL -

Image
i've been working on little 3d engine trying fix camera , make less jerky. i've been using sdl input , while works it's doing thing if press , hold button instantly move once pause , start moving making movement feel unresponsive. i recorded gif of , while may hard see what's happening it'll give idea: moving forward , right like: w wwwwwwwwwwwwwwww aaaaaaaaaaaaaaaaaaaaa the important code here feel free ask more if necessary: //poll events sdl_event event; while (m_enginestate != enginestate::exit) { m_last = m_current; m_current = sdl_getperformancecounter(); deltatime = (double)((m_current - m_last) * 1000 / sdl_getperformancefrequency()); while (sdl_pollevent(&event)) { switch (event.type) { case sdl_quit: m_enginestate = enginestate::exit; break; case sdl_mousemotion: break; case sdl_keyd

javascript - Chrome console accessing DOM -

when put in chrome console like: document.getelementbyid('scroller') i like: <div class="blah" id="scroller>...</div> but if pause script , throw in watch same expression i'll javascript object, how javascript object in regular console like: document.getelementbyid('scroller'): div#scroller.multiplefiles accesskey: "" align: "" attributes : namednodemap baseuri : "http://localhost:3000/cards.html#card-text-download-cycler" childelementcount: 12 childnodes: nodelist[25] ... console.dir(document.getelementbyid('scroller'))

android - borderTopLeftRadius and borderBottom on react-native -

Image
i have button component in react-native this: <view style={{ ... }}> <touchableopacity style={{ bordertopleftradius: 5, borderbottomwidth: 2, borderbottomcolor: 'red', ...}} > <text> button </text> </touchableopacity> </view> and result this: but want this: why there shade in left bottom? normal?

php - WAMPserver 3.0.4 on Windows 10 (64 bit): Apache server (httpd service) did not start -

i installed wampserver 3.0.4 x64 bit on windows 10 64 bit os. issue: apache server (2.4.18) did not start following error message: could not execute menu item (internal error) [exception] not perform service action: service did not respond start or control request in timely fashion similar question raised before on stackoverflow, resolutions posted there didn't in case. (i've mentioned details below). diagnosis : step 1: tested port 80, since apache server using one. here test returned: ***** test uses port 80 ***** ===== tested command netstat filtered on port 80 ===== test tcp port 80 not found associated tcp protocol port 80 not found associated tcp protocol ===== tested attempting open socket on port 80 ===== port 80 not used. step 2: though result showed port 80 not issue, tried change port number 80 8080. still received same error. test showed port 8080 not being used either. so, issue not port number. step 3: changed php version