Posts

Showing posts from June, 2011

php - Publish Laravel Project and Project Deployment on LAMP -

i developing php website using laravel 5 framework. published website through git clone server. however, after visiting url, website shows structures, shown as: http://mikemikezhu.me/laravel/laravel_trial/ the index.php in public folder cannot parsed, , folder structure displayed. server running centos 7 system. web server apache , php version 5.4.16. wondering whether because php version old run laravel. or there other ways publish website correctly? not going use forge , envoyer bacause not free of charge. check if have correct php version application command: php -v if using laravel 5.0 need php >= 5.4, php < 7 if using laravel 5.1 need php >= 5.5.9 if using laravel 5.2 need php >= 5.5.9 if deploying app git, check if folder permissions correct , compatible apache user.

C++ OpenCV assertion failed error -

i'm trying create code copies pixels 1 image , arranges them differently, error opencv error: assertion failed 0 && size.height>0> in cv::imshow, file c:\builds\2_4_packslave-win64-vc12-shared\opencv\modules\highgui\src\window.cpp, line 261 here's code int main(int argc, char** argv) { mat src = imread("srcimg.jpg", 1); mat dst = imread("dstimg.jpg", 1); int srch = src.rows; int srcw = src.cols; int dsth = dst.rows; int dstw = src.cols; double alpha; int r = 50; (int = 0; < srch; i++) { (int j = 0; j < srcw; j++) { alpha = / r; dst.at<uchar>(dstw / 2 * cos(alpha), (dsth / 2 + r) * sin(alpha)) = src.at<uchar>(i, j); } } imshow("source", src); imshow("result", dst); return 0; what can problem here?

How to generate Array of items in html template for creating pdf in Node Js? -

i using html-pdf pdf creation on project. can generate details pdf. thing can not able create list of items in array in html(which used pdf conversion).       since cannot use javascript array of items, unable it. if there tweak use javascript in html template,please post here. since array of items known, can use easily. suppose if array length 3 . can use array[0].name ,array[1].name, array[2].name here don't know length of array consists of how many items. can please me here generate table of items generating dynamically. you cannot use javascript in template, can use javascript on it. the idea make parser : read template replace keywork (for example : <customtable arrayname="mycustomarray" fields="['name']" /> ) generated html array in node.js . use template html-parser . i write example of parser in vanillajs here : https://jsfiddle.net/rbuuzcre/5/

java - Spring Boot , JNDI lookup database with application.properties -

i create rest service jersey , spring boot , spring data. my setup java 1.8 , maven 3.3.9 , spring framework 4.3.0.release , jersey 2.23.1 , spring boot 1.3.6.release , javax.ws.rs-api 2.0.1 , hibernate 5.1.0.final i try build datasource via defining in context.xml , referencing in application.properties . see method permdbjpadatasource() . seems entry spring.datasource.jndi-name=jdbc/permdb ignored. bean named permdbjpadatasourcefail created, properties null (database url, db user etc...). can see file application.properties evaluated, because of spring.main.banner-mode=off . the method jndidatasource() works fine, , can build application way. know if i'm doing wrong or if it's bug. these sources: ├───java │ └───com │ └───pkg │ └───permdb │ └───service │ │ permdbserviceapplication.java │ │ │ ├───services │ │ permdbowsservice.java │

javascript - Angular directive not aplying style -

i have question styles angularjs directives. have imported bootstrap directive progressbars inside project. i'm using inside div class created. <div class="diagnostics-widget-modal"> <div class="modal-header"> <h3>some content</h3> </div> <div class="modal-body"> <div class=left-workflow-area> <uib-progressbar value="55"></uib-progressbar> </div> </div> </div> when run page directive html rendered correctly , piece of code becomes following. <div class="modal-body"> <div class="left-workflow-area"> <div class="progressbar ng-isolate-scope" value="55"> <div class="progress"> <div class="progress-bar" ng-class="type &amp;&amp; 'progress-bar-' + type" role="p

jQuery - Remove all child elements before specific child -

jsfiddle: https://jsfiddle.net/9krvkfpw/ hi, i'm trying remove child elements point i'm not sure effective way is. here's example code: <div id="container"> <div id="el1">remove</div> <div id="el2">remove</div> <div id="el3">remove</div> <div id="el4">remove</div> <script type="text/javascript"> // keep </script> <div id="lastel">keep</div> </div> essentially, want remove elements above script element. can't find first script element because there's more above 1 want keep, they'll in way. my idea script tag hitting #lastel , getting previous element. like this: var script = $('#container').children('#lastel').prev(); from here i'm not sure best way proceed is, or if best way? i script.prev().remove() multiple times, isn't going

adsense - What are some ways to protect admob account from getting suspended because of others making fake clicks? -

it off-topic please helpful of getting fake clicks unknown sources our admob account suspended. for ios you should count how many times user has clicked on ad, using delegate methods stated here . can use touchesbegan . each time detect user clicks ad, increment value in nsuserdefaults or something. , maybe each week or month, reset value 0. way can count how many clicks every week/month. if user clicks ad, say, more 5 times week, should stop showing ad. how? don't send gadrequest ! can present uialertcontroller tell user. for android you should count how many times user has clicked on ad, using event listener mentioned here . each time detect user clicks ad, increment value in sharedpreferences or something. , maybe each week or month, reset value 0. way can count how many clicks every week/month. if user clicks ad, say, more 5 times week, should stop showing ad. how? don't send adrequest ! can show toast tell user.

actionscript 3 - After end of MouseMove or drag event menu keeping from release menu items -

i having problem draggable menu including menu button items. @ end of drag operation (when lift finger screen) button sub item works because of mouse_up code. i need drag end drop menu. after drop menu button items listeners should start release (mouse_up). how can separete them? i read similar messages couldnt solve problem. my code: addeventlistener(mouseevent.mouse_move, dragstart); addeventlistener(mouseevent.mouse_up, dragstop); function dragstart(e:mouseevent):void { e.currenttarget.startdrag(false,new rectangle(0,0,500,0)); } function dragstop(e:mouseevent):void { e.currenttarget.stopdrag(false,new rectangle(0,0,500,0)); } thanks.. my sample file here update: getting wrong. i'd suggest switching flag in parent clip when dragged , ignore mouse_up events in children if true . in parent: var dragging:boolean = false; function dragstart(e:mouseevent):void{ e.currenttarget.startdrag(false,new rectangle(0,0,500,0)); dragging = t

javascript - mydata.feed is undefined ionic angularjs -

i using ionic angularjs , want data json have problem withe code var app = angular.module('app.news', ['ionic']); app.controller('myctrl', function($scope, $http) { $http.get("https://graph.facebook.com/v2.5/me?") .then(function(mydata) { $scope.news = mydata.feed.data; }); }); html <ion-view title="الرئيسية" id="page2" style="background-color:#ffffff;" class=" "> <ion-content padding="true" class="has-header"> <div ng-controller="myctrl"> <h1>{{news.message}}</h1> </div> </ion-content> </ion-view> error: mydata.feed undefined some please try mydata.data.feed.data your response wrap inside data returns promise object. the response object has these properties: data – {string|object} – response body transformed transform functions. status – {number} – http statu

android - Can we handle result of Facebook signup like Facebook login? -

can result facebook create account facebook login our application? i'm able user information in login when user sign facebook redirects facebook website , aren't able users information. is there way track if user selected facebook login or sign up?

ansible-playbook --limit not working with overlapping host aliases -

im having problem limiting ansible work specific host my inventory file looks this: [staging-docker-containers] app1 ansible_host=host.domain.com ansible_ssh_port=2222 app2 ansible_host=host.domain.com ansible_ssh_port=2223 app3 ansible_host=host.domain.com ansible_ssh_port=2224 [staging-other-servers] app1 ansible_host=host.domain.com ansible_ssh_port=2225 app2 ansible_host=host.domain.com ansible_ssh_port=2226 app3 ansible_host=host.domain.com ansible_ssh_port=2227 when run follow command ansible-playbook --limit="staging-docker-containers:app3" my-playbook.yml -i staging it ignores limit command , tries connect app3 under staging-other-servers group, , not app3 under staging-docker-containers group. am doing wrong? you can have same host in different groups. can't have different hosts under same name. if define same host variables same host in different places, latter have priority. inventory becomes: [staging-docker-conta

jquery - Javascript adjust div position after zoom -

i'm working on script there image on canvas. user can zoom on image mouse wheel (using d3js zoom), zoom centered mouse position. my problem have div on canvas supposed highlight parts of image. div position should updated when zooming still highlight same spot. i'am struggling find way it. here's jsfiddle basic example, want div cover same spot of image when zooming. code used zoom image: function zoom() { var e = d3.event; var tx = math.min(0, math.max(e.translate[0], 408 - 408 * e.scale)); var ty = math.min(0, math.max(e.translate[1], 464 - 464 * e.scale)); context.save(); context.clearrect(0, 0, 408, 464); zoome.translate([tx, ty]); context.translate(tx, ty); context.scale(d3.event.scale, d3.event.scale); context.drawimage(imageobj, 0, 0, 408, 464); context.restore(); } thanks.

What are the disadvantages of Spring Boot for Java web applications? -

[this needs voted reopened answer.] spring boot tipped being default go when making new spring application makes set easier , automatically wires in common dependencies. yet in industry see spring-boot used in manner advertised. factually , concisely, disadvantages faced developers on adoption of spring boot de facto spring go to? the advantages of spring boot question ( not closed being opinion based ) shows advantages of agree there many believe there should fuller view. an example non opinion based point be: spring boot may unnecessarily increase deployment binary size unused dependencies. not being able customize logging shown here . this opinion based question believe biggest disadvantage might encounter using or spring @ without understanding value gave or project. might not aligned requirements , possible configure @ point. let me comment bullet points liked in question . create stand-alone spring applications => can create standalone java appl

what does the $ means in .hprof file android studio -

Image
after initiating gc , clicking dump java heap in android studio monitor ,this image below appears what $ next class dialogfrag in dialogfrag$1 means ? (dialogfrag class extends dialogfragment) suppose have 1 instance of class ,but can see next dialogfrag$1 total count 7 , mean have memory leak? edit: dialog fragment class public class dialogfrag extends dialogfragment { asynctask<void,void,void> asynctask; @override public dialog oncreatedialog(bundle savedinstancestate) { alertdialog.builder alertdialog=new alertdialog.builder(getactivity()); alertdialog.settitle("solution:"); view view = getactivity().getlayoutinflater().inflate(r.layout.dialogfrag,null); final myview myview= (myview) view.findviewbyid(r.id.myview); myview.setvisibility(view.invisible); alertdialog.setview(view); asynctask=new asynctask<void, void, void>() { @override

use virtualenv site-packages with other python installation -

i have web application written in python has run on shared linux dumb provider (i have use cgi...). when had deployed page, things have needed weren't available, had installed of them locally in home. no provider decided support 64 bit, hence local 32 bit binaries broken. now have fix situation. tried use (now available) global installations of python, sqlite3 , forth changing she-bang in main script , add sys.path.append site-packages of prior virtualenv installation. the script executable , libraries site-packages loaded, not , don't know problem , how fix it. satisfied using virtualenv without understanding internals.

haskell - Storing an Enum type in an unboxed Vector -

suppose have this: data colour = red | blue | green deriving (eq, ord, enum, bounded, read, show) and want have unboxed vector of colour s. cannot directly (because colour isn't instance of unbox ), can't tell how write unbox instance colour . the documentation unbox doesn't seem how make instance of (or @ least, not in way understand). one approach use data.vector.unboxed.deriving , uses template haskell define correct instances new types in terms of existing types unbox instances. {-# language multiparamtypeclasses, typefamilies, templatehaskell #-} module enum import qualified data.vector.unboxed u import data.vector.generic.base import data.vector.generic.mutable import data.vector.unboxed.deriving import data.word data colour = red | blue | green deriving (eq, ord, enum, bounded, read, show) colourtoword8 :: colour -> word8 colourtoword8 c = case c of red -> 0 blue -> 1 green -> 2 word8tocolour :: w

How can I make labels invisible on load in Access 2007 -

i've got logger form hides text , combo boxes until hit "start activity" there anyway can make labels disappear on load , appear once start button pressed? here sample of code: private sub form_load() struserid = environ("username") appversion = "version - " & dlookup("version", "version", "id = 1") & " - " & dlookup("versiondate", "version", "id = 1") me.txtversion = appversion me.cmdstartcall.visible = true me.txtpolicyclaimreference.visible = false me.txtjobreference.visible = false me.txtnotes.visible = false me.cbocontactmethod.visible = false me.cbotitle.visible = false me.cbodepartment.visible = false me.cbolocation.visible = false me.txtscheme.visible = false me.txtfirstname.visible = false me.txtsurname.visible = false end sub so if assume each txt or cbo box has same name label, how can them not show unless activated? thanks dan the la

angular - How to load all images I will use in one services? -

i wondering, how can load of images collection of strings, example: ['/picutre1.png','/picture2.png'] when navigating webpage displays images, user has them cached? enough make request those? based on kind of images services return. if services can return base64 images think can store kind of cached redis or memcahced. so in every webpages need images can set unique key bind images. sorry bad english

javascript - ES6 declaring variables before or in loop -

where , how should declare new variables used in loops? a: const map = new map(object.entries(columns)); let cols; (let [key, value] of map) { cols = value.split('|'); //... } b: const map = new map(object.entries(columns)); (let [key, value] of map) { let cols = value.split('|'); //... } c: const map = new map(object.entries(columns)); var cols; (let [key, value] of map) { cols = value.split('|'); //... } probably or b since says let new var, there difference between , b? edited: variable cols used inside for. wondering if there issues if variable initialized inside loop (for example 100 times). wondered if should initialized outside loop. (a or b example) the purpose not access outside loop, prevent (for example) 100 initialization variable cols inside loop (because let used inside loop - case b). in code snippet a, cols accessible outside of for too. let variables block-scoped, when used let define v

c++ - What does this vector push_back statement mean? -

waht following mean? vector<vector<pair<int, int>>> graph; graph.push_back(vector<pair<int, int>>()); // statement mean? i wondering because statement didn't have values. can see rest of code browsing initialized locations being referenced later in code. that's pretty thought, not sure. sorry if newbie question, i'm new vectors. replies. it "adds" newly initialized vector<pair<int,int>> "back" of vector name graph (i.e. after last entry, if any).

Java regex Pattern matches doesn't recognise "Escape +" -

this question has answer here: java regex pattern matches in online tester doesn't in eclipse 1 answer i trying pattern ^\\+[0-9]+ match +852(2)78911 , seems pattern.matches("^\\+[0-9]+", s) is returning false . when tried in regexr working fine i.e. giving me match. not escaping correctly in java sense? try regex instead: ^\\+[0-9\\(\\)]+$

sql server - SQL Syntax to Insert Dates and Times into a Database -

in project, need convert following function, creates string insert database, correct syntax inserting datetime datatype... know way can this? public shared function sqlstring(str string) string return "'" & str.replace("'", "''") & "'" end function sql = "insert tblmodules(moduleid, modulename, numberusers, license, username, contractid,datetime) values(" & modid & ", " & sqlstring(modname) & ", " & numusers & "," & sqlstring(license) & ", " & sqlstring(username) & ", " & contractid & ","&sqldatetime(datetime.now)&")" try this

Java - Turning Integers into Character with a Charset -

need convert int char representation. did : char c = (char) integer; but doesn’t support charset. thought using this: string s = new string(byte[], charset); or : charset.forname("utf-8").newdecoder().decode(bytebuffer); but both of them needs bytes. how can turn int char charset? thank in advance.

mysql - Referencing column depending on Ids of another column in sequence -

i trying update (reference) column (oid) of 1 table oid of table's column condition. example : customer table : ------------------ cid name oid ------------------- 1 abc null 2 abc null 3 abc null 4 xyz null -------------------- order table -------------- oid name -------------- 10 abc 11 abc 12 abc 13 xyz -------------- ouput should : customer table : ------------------ cid name oid ------------------- 1 abc 10 2 abc 11 3 abc 12 4 xyz 13 -------------------- i have tried following update customer c, order o set c.oid = o.oid c.name = o.name; ----------------------------- update customer inner join order on customer.name=order.name set customer.oid=order.oid customer.oid null; but customer table being updated follows customer table : ------------------ cid name oid ------------------- 1 abc 10 2 abc 10 3 abc 10 4 xyz 13 -------------------- the idea assi

vba - Copying and Pasting Filtered Table Problems -

Image
i have sub copies , pastes filtered table new worksheet, want copy cell values on only, not formulas. sub pastefilteredtabletotempsheet(byref tempws worksheet, byref calcws worksheet) calcws.activate dim newtable listobject set newtable = calcws.listobjects("full_bearings_list") newtable.databodyrange.specialcells(xlcelltypevisible).copy _ destination:=tempws.range("a1") 'tempws.range("a1").pastespecial xlpastevalues 'application.cutcopymode = false end sub the 2 lines commented out not want, copies cell values on new worksheet data not formatted table, destination syntax automatically formatted table formulas copied, not values only. the link shows 2 examples. want format of left image table values, not formulas. just paste twice. tempws.range("a1").pastespecial xlpastevalues tempws.range("a1").pastespecial xlpasteformats

php - Retrieve table column in view -

just started working laravel & i'm trying save both item , quantity. far, have no idea how retrieve item's value table column. here's code html <table class="table table-condensed table-hover" id="mytable"> <thead> <tr> <th>item</th> <th class="text-center">quantity</th> </tr> </thead> <tbody class="body"> <tr> <td name="item[]">book</td> <td> <select class="form-control" name="qty[]"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> </select> </td> </tr> <tr> <td name="item[]">pencil</td> <td> <select class="form-contro

packagist - Composer Content-Length Mismatch -

sometime, when run composer update upgrade laravel project, may occur content-length mismatch exception. finally, because terrible firewall in china: dns poisoned. so, if 1 me, follows fix out. first, run: composer config --list --global //this composer home path. [home] /root/.composer //it's composer home path. and then, edit config.json, make this: { "config": { "github-protocols": [ "https" ] }, "repositories": { "packagist": { "type": "composer", "url": "https://packagist.org" } } } it make packagist connection force https. , config composer.json in project, laravel sample like: { "name": "laravel/laravel", "description": "the laravel framework.", "keywords": [ "framework", "laravel" ], "license": &q

Entity Framework - SaveChanges not reflected in database -

savechanges not being reflected in database i have following code public async task<int> post([frombody] userentry userentry) { userentry dbuserentry; using (dbcontext db = new dbcontext()) { // update dbuserentry = this.db.userentries .where(u => u.userentryid == userentry.userentryid) .include(u => u.entryplayers.select(y => y.player)) .firstordefault(); dbuserentry.teamname = userentry.teamname; dbuserentry.entryplayers = userentry.entryplayers; //db.entry(dbuserentry).state = entitystate.modified; return db.savechanges(); } } i read somewhere need set state modified if uncomment line //db.entry(dbuserentry).state = entitystate.modified; i error:- an entity object cannot referenced multiple instances of ientitychangetracker. any ideas on how can savechanges work? use find() method instead of firstordefault() dbuserentry =

java - Syntax Error: Import statement with multiple semi-colon -

this might weird question, valid one. know below statement not have compilation error: arraylist list = new arraylist();;; //(with 3 `;` semi-colon) okay have written below import statement: import java.util.arraylist;;; (with 3 `;` semi-colon) but got below compilation error: syntax error on token ";", invalid staticimportondemanddeclarationname why? what have here: arraylist list = new arraylist();;; //(with 3 `;` semi-colon) is not statement terminated 3 semi-colons. it's statement terminated 1 semi-colon, followed 2 empty statements . an empty statement legal in java, import section of java source file not comprised of statements, it's comprised of import declarations. jls 14.6 defines empty statement: an empty statement nothing. emptystatement: ; execution of empty statement completes normally. a perhaps-legitimate use of empty statement: //loop forever while (true) {;} // body of loop empty statement.

php - QR CODE not printing -

i generating qr code url data content, when try print page qr generated, qr not seem appear yet other content displays. here snippet <?php require_once("qrcode.php"); //--------------------------------------------------------- $qr = new qrcode(); // ƒgƒ‰[’ù³ƒŒƒxƒ‹‚ðÝ’è // qr_error_correct_level_l : 7% // qr_error_correct_level_m : 15% // qr_error_correct_level_q : 25% // qr_error_correct_level_h : 30% $qr->seterrorcorrectlevel(qr_error_correct_level_l); $qr->settypenumber(4); $qr->adddata("http:/".$_server['request_uri'].""); $qr->make(); //--------------------------------------------------------- ?> and below other content on page <div class="invoice-box" id="invoice-box"> <table cellpadding="0" cellspacing="0"> <tr class="top"> <td colspan="2"> <table> <tr

r - Adding " \\ \hline " after every component of a vector -

consider following: v <- letters[1:4] v [1] "a" "b" "c" "d" i following output using v : "a \\ \hline b \\ \hline c \\ \hline d \\ \hline" or version quotation marks removed. closest i've gotten paste0(v, collapse = " \\ \\hline ") [1] "a \\ \\hline b \\ \\hline c \\ \\hline d" and ctrl + f find , replace in rstudio using \\hline -> \hline , simple enough, see if there's way create string without step. this problem comes when want create tabular environment using character vector in .rnw file using latex code. if printing, can use cat cat(v, sep = " \\\\ \\hline ")

multithreading - Why does an empty while in Java not break when condition is set by other thread? -

while trying unit test threaded class, decided use active waiting control behavior of tested class. using empty while statements failed intended. question is: why first code not complete, second does? there similar question , doesn't have real answer nor mcve , far more specific. doesn't complete: public class threadwhiletesting { private static boolean wait = true; private static final runnable runnable = () -> { try {thread.sleep(50);} catch (interruptedexception ignored) {} wait = false; }; public static void main(string[] args) { wait = true; new thread(runnable).start(); while (wait); // line important } } does complete: public class threadwhiletesting { private static boolean wait = true; private static final runnable runnable = () -> { try {thread.sleep(50);} catch (interruptedexception ignored) {} wait = false; }; public static void main(string[] args)

servlets - Dowload link in Java, Spring MVC -

i trying implement link in webpage download file csv. content of file being appended stringbuffer , flushed response there itself. code below tried achieve : public void getdownloadfile(httpservletresponse response) throws ioexception{ response.setcontenttype("application/octet-stream"); response.setheader("content-disposition","attachment;filename=data.csv"); servletoutputstream out = response.getoutputstream(); try{ stringbuffer sb = generatecsvfilebuffer(); inputstream in = new bytearrayinputstream(sb.tostring().getbytes("utf-8")); byte[] outputbyte = new byte[4096]; while(in.read(outputbyte, 0, 4096) != -1) { out.write(outputbyte, 0, 4096); } in.close(); out.flush(); out.close(); } catch (exception e) { system.out

javascript - Set textarea exact width, based on number of chars -

having following problem. i have limit users maximum number of chars, per line, on textarea, seems cols not trick, when including vertical scrollbar: .textarea1 { resize: none; font-family: monospace; } when no scrollbar visible, works fine using 50 chars. <br /> <textarea class="textarea1" cols="50" rows="3">123456789!123456789!123456789!123456789!123456789!</textarea> <br /> in case, when scrollbar visible, @ least 3 chars go next line. <textarea class="textarea1" cols="50" rows="3">1234567890123456789!1234567890123456789!123456789!123456789!1234567890123456789!1234567890123456789!123456789!1234567890123456789!123456789!123456789!123456789!123456789!123456789!123456789!123456789!</textarea> <br /> in case, when use 10 chars, can fit 1 char on each line. <br /> <textarea class="textarea1" cols="10" rows="3">

c++ - 'default' as a variable name -

while debugging code, came across array named default . thought keywords not allowed variable names. #include "stdafx.h" #include <stdio.h> int main() { int default = 5; printf("%d\n", default); return 0; } now above code compiles without hitch on vs 2008. isn't 'default' keyword? how come works variable name? side-effects? ps: infragistics::win::ultrawintoolbars::toolbarscollection has property name! it's known issue in vc++. by-design c++/cli compatibility.

c# - Why does sqlite converts . To , -

i confused sqlite right now. use system.data.sqlite version c# i have 2 tables: table 1: in have created 2 columns (more important in case , statement way long post it). first 1 called recstat , second 1 doxinm. both decimal , created this: ... [rectstat] decimal, [doxinm] decimal, ... the create table statement looks this: create table if not exists "table1" (..columns..); when insert value in table decimal works fine , when read out works on xaml gui. after created second table has decimal column. created table same way (this short one, can give whole statement) create table if not exists "table2" ( [id] integer not null primary key, [material] varchar(10], [thickness] decimal); c# code creation (note work const string sql commands): mysqlitecommand.commandtext = @"" + databasepara.create_sql + " " + databasepara.table_sql + " " + databasepara.if_sql + " " + databasepara.not_sql + " " +

angular - Pass data from child component to template in angular2 -

i've got 2 components - home , counter , want able increment template variable in counter home. doesn't work, except initialization - variable initialized 17, after increment doesn't work. countercomponent import { component, input } '@angular/core'; @component({ selector: 'counter', styleurls: ['app/counter.component/style.css'], templateurl: 'app/counter.component/counter.component.html' }) export class countercomponent { public counter: number = 17; activate() { this.counter++; } deactivate() { this.counter--; } } counter.component.html the counter is: {{counter}} homecomponent import { component } '@angular/core'; import { countercomponent } './counter.component/counter.component'; @component({ selector: 'home', directives: [countercomponent], providers: [countercomponent], templateurl: 'app/home.component.html' }) export class homecomponent { constr

eclipse - xtext custom scoping: parameters of function -

i trying custom scoping, such if have function in language parameters, want parameters visible until there semicolon, , out of scope, want not visible. i tried redefine method getscope() in file mydslscopeprovider.xtend in getscope did this: if (eclassname=="typedparam" && efeaturename=="type" && contexttype == "typedparam"){ return scopes.scopefor(collections.singleton(context),iscope.nullscope) } this abviosly doesn't working (it doesn't recognize parameters). how can it? moreover, have question: tried implements methods like: def iscope scope_<eclass name>_<efeature name>(<context type> context, ereference) although printed names , made sure writing name correct, method never called. (i copied printed following code) class domainmodelscopeprovider extends abstractdomainmodelscopeprovider { override def iscope getscope(eobject context, ereference reference) { sys

c# - Open gallery in simulator on image tap -

i want open gallery in iphone simulator upon button click. using xamarin forms - xaml create pages , image views. what have implemented far : have galleryservice specific ios implements igalleryservice has method selectimage. selectimage creates uiimagepickercontroller _imagepicker. in ios specific apps, do navigationcontroller.presentmodalviewcontroller(_imagepicker, true); but how similar using navigation in xamarin forms? ps: have created view in .xaml file , move across pages in xaml.cs file navigation.pushmodalasync(page) here, page must contain _imagepicker view, right? how that? kindly correct me if wrong. xamarin.forms utilises single navigationcontroller on ios host different pages. of xamarin content pages navigation happens internally in xf, inside single main navigationcontroller. you cannot mix other native view controllers inside navigationpage stack. can use native code , treat 1 navigationcontroller forms uses single "screen".

sql server - TSQL: access user data from LDAP -

Image
i have active directory (ldap) stores user information. i'm trying access using tsql, i'm having authentication problems. the ldap looks (i edited data): the user has following properties: now, i'm trying info user through tsql query sql server using openrowset so: select * openrowset('adsdsoobject','adsdatasource'; 'domain.com.io\test';'the_sha1_pass', 'select givenname ''ldap://domain.com.io/ou=users, dc=domain,dc=com,dc=io'' givenname = ''test'' ') but when execute following error: server: msg 7399, level 16, state 1, line 1 ole db provider ' adsdsoobject ' reported error. provider indicates user did not have permission perform operation. now, don't know if have send authentication of user i'm trying query over, or credentials use connect ldapadmin. , if have send it, should send pass encrypted or without encryption? thanks. y